|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- The type of data that the list stores.public interface List<T>
An interface for the List ADT.
Method Summary | |
---|---|
boolean |
add(int newPosition,
T newItem)
Adds newItem at the given index. |
void |
add(T newItem)
Adds newItem to the end of the list. |
T |
at(int position)
Returns the item at a given index. |
void |
clear()
Removes all items from the list. |
boolean |
contains(T targetItem)
Returns true if the list contains the target item. |
boolean |
isEmpty()
Returns true if the list has no items stored in it. |
java.util.Iterator<T> |
iterator()
Returns an iterator that begins just before index 0 in this list. |
int |
length()
Returns the length of the list: the number of items stored in it. |
T |
remove(int position)
Removes the item at the given index. |
boolean |
replace(int position,
T newItem)
Replaces the item at a given index. |
java.lang.Object[] |
toArray()
Returns an array version of the list. |
Method Detail |
---|
void add(T newItem)
boolean add(int newPosition, T newItem)
T remove(int position)
void clear()
T at(int position)
boolean replace(int position, T newItem)
boolean contains(T targetItem)
int length()
boolean isEmpty()
java.lang.Object[] toArray()
java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |