|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IList<E>
Interface for a simple List. Random access to all items in the list is provided. The numbering of elements in the list begins at 0.
Method Summary | |
---|---|
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, []. |
Method Detail |
---|
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 item
E get(int pos)
pos
- specifies which element to get
E remove(int pos)
pos
- the position of the element to remove from the list
boolean 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 list
int indexOf(E item, int pos)
item
- the element to search for in the listpos
- the position in the list to start searching from
void makeEmpty()
Iterator<E> iterator()
iterator
in interface Iterable<E>
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()
toString
in class Object
boolean equals(Object other)
equals
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |