public interface SimpleList
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object o)
Add the given object at the given location, shifting elements as
necessary.
|
void |
addAll(SimpleList c)
Add the items in the given list to the end of the receiver.
|
void |
addFirst(java.lang.Object o)
Add the given object to the front of the list.
|
void |
addLast(java.lang.Object o)
Add the given object to the rear of the list.
|
void |
clear()
Remove all elements.
|
boolean |
contains(java.lang.Object o)
Answer true iff the given object is in the list.
|
java.lang.Object |
get(int index)
Answer the element at the given location.
|
java.lang.Object |
getFirst()
Answer the first element in the list.
|
java.lang.Object |
getLast()
Answer the last element in the list.
|
int |
indexOf(java.lang.Object o)
Answer the index of the first occurrence of the object in the list.
|
boolean |
isEmpty()
Answer size() == 0
|
SimpleIterator |
iterator()
Answer an iterator over the elements of the list.
|
java.lang.Object |
remove(int i)
Remove the item at the given index, shifting elements as necessary.
|
boolean |
remove(java.lang.Object o)
Remove the first occurrence of the given object.
|
java.lang.Object |
removeFirst()
Remove the first element.
|
java.lang.Object |
removeLast()
Remove the last element.
|
java.lang.Object |
set(int index,
java.lang.Object o)
Replace the element at the given location.
|
int |
size()
Answer the number of elements in the collection.
|
void addFirst(java.lang.Object o)
void addLast(java.lang.Object o)
void add(int index, java.lang.Object o)
index
- must be >= 0 && <= lengthvoid addAll(SimpleList c)
java.lang.Object set(int index, java.lang.Object o)
index
- must be >= 0 && < lengthjava.lang.Object get(int index)
index
- must be >= 0 && < lengthjava.lang.Object getFirst()
java.lang.Object getLast()
boolean contains(java.lang.Object o)
int indexOf(java.lang.Object o)
void clear()
java.lang.Object removeFirst()
java.lang.Object removeLast()
boolean remove(java.lang.Object o)
java.lang.Object remove(int i)
int size()
boolean isEmpty()
SimpleIterator iterator()