public interface IList<E> extends Iterable<E>
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item)
Add an item to the end of this list.
|
boolean |
equals(Object other)
Determine if this IList is equal to other.
|
E |
get(int pos)
Get an element from the list.
|
IList<E> |
getSubList(int start,
int stop)
Return a sublist of elements in this list from start inclusive to stop exclusive.
|
int |
indexOf(E item)
Find the position of an element in the list.
|
int |
indexOf(E item,
int pos)
find the position of an element in the list starting at a specified position.
|
void |
insert(int pos,
E item)
Insert an item at a specified position in the list.
|
Iterator<E> |
iterator()
return an Iterator for this list.
|
void |
makeEmpty()
return the list to an empty state.
|
boolean |
remove(E obj)
Remove the first occurrence of obj in this list.
|
E |
remove(int pos)
Remove an element in the list based on position.
|
void |
removeRange(int start,
int stop)
Remove all elements in this list from start inclusive to stop exclusive.
|
E |
set(int pos,
E item)
Change the data at the specified position in the list.
|
int |
size()
Return the size of this list.
|
String |
toString()
Return a String version of this list enclosed in
square brackets, [].
|
void add(E item)
item - the data to be added to the end of this listvoid insert(int pos,
E item)
pos - the position to insert the data at in the listitem - the data to add to the listE set(int pos, E item)
pos - the position in the list to overwriteitem - the new item that will overwrite the old itemE get(int pos)
pos - specifies which element to getE remove(int pos)
pos - the position of the element to remove from the listboolean remove(E obj)
obj - The item to remove from this list.IList<E> getSubList(int start, int stop)
start - index of the first element of the sublist.stop - stop - 1 is the index of the last element of the sublist.int size()
int indexOf(E item)
item - the element to search for in the listint indexOf(E item, int pos)
item - the element to search for in the listpos - the position in the list to start searching fromvoid makeEmpty()
Iterator<E> iterator()
void removeRange(int start,
int stop)
start - position at beginning of range of elements to be removedstop - stop - 1 is the position at the end of the range of elements to be removedString toString()