Class tred.ListObject
All Packages Class Hierarchy This Package Previous Next Index
Class tred.ListObject
java.lang.Object
|
+----tred.ListObject
- public class ListObject
- extends Object
This is a ListObject class that will store a list of objects.
-
ListObject()
-
This is the constructor for ListObject.
-
add(Object)
- This method inserts object as an element at the first position.
-
append(Object)
- This method appends the new object to the list.
-
elements()
- return an Enumeration for the current list of elements.
-
firstElement()
-
-
indexOf(Object)
-
-
insert(Object, Object)
- This method inserts object as an element at the position after object
after.
-
insertBefore(Object, Object)
- This method inserts object as an element at the position before object
befObj.
-
lastElement()
-
-
remove(Object)
-
Deletes the element object from the vector.
-
size()
-
-
toString()
-
ListObject
public ListObject()
- This is the constructor for ListObject. A new empty Vector is allocated
for the elements this ListObject contains.
firstElement
public Object firstElement()
lastElement
public Object lastElement()
remove
public void remove(Object object)
- Deletes the element object from the vector. If the object is not an
element, remove reports an error to the standard err.
add
public void add(Object object)
- This method inserts object as an element at the first position. Elements
in the vector are shifted over to make room.
insert
public void insert(Object object,
Object after)
- This method inserts object as an element at the position after object
after. Elements in the vector are shifted over to make room. If
object after is not in the vector a new element is inserted at
the first position.
insertBefore
public void insertBefore(Object object,
Object befObj)
- This method inserts object as an element at the position before object
befObj. Elements in the vector are shifted over to make room. If
object befObj is not in the vector a new element is inserted at
the first position.
append
public void append(Object object)
- This method appends the new object to the list.
indexOf
public int indexOf(Object obj)
elements
public Enumeration elements()
- return an Enumeration for the current list of elements.
size
public int size()
- Returns:
- the number of elements currently in the vector. Note that this
is not the same as the Vector's capacity.
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index