Package kr.ac.konkuk.ccslab.cm.entity
Class CMList<T>
java.lang.Object
kr.ac.konkuk.ccslab.cm.entity.CMList<T>
- Type Parameters:
T- - T is the class of a list element.
The CMList<T> class represents a list of CM objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddElement(T element) Adds an element to the list.findElement(T element) Finds an element in the list.getList()Returns the Vector of this list.intgetSize()Returns the size of list.booleanisEmpty()Tests if this list has no element.voidRemoves all elements from the list.booleanremoveElement(T element) Removes an element from the list.toString()
-
Constructor Details
-
CMList
public CMList()Creates an instance of the CMList class.
-
-
Method Details
-
addElement
Adds an element to the list.- Parameters:
element- - an element of T type- Returns:
- true if the element is successfully added to the list; false otherwise.
-
removeElement
Removes an element from the list.- Parameters:
element- - an element of T type- Returns:
- true if the element is successfully removed from the list; false otherwise.
-
removeAllElements
public void removeAllElements()Removes all elements from the list. -
findElement
Finds an element in the list.- Parameters:
element- - an element of type T- Returns:
- true if the element is found; false otherwise.
-
getSize
public int getSize()Returns the size of list.- Returns:
- the size of list.
-
isEmpty
public boolean isEmpty()Tests if this list has no element.- Returns:
- true if this list has no element; false otherwise.
-
getList
Returns the Vector of this list.- Returns:
- the Vector of this list.
-
toString
-