|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for a list.
Method Summary | |
Iterator |
elements()
Returns an iterator of all the elements in the list. |
Position |
first()
Returns the first node in the list. |
Position |
insertAfter(Position p,
Object e)
Inserts an element after the given node in the list. |
Position |
insertBefore(Position p,
Object e)
Inserts an element before the given node in the list. |
Position |
insertFirst(Object e)
Inserts an element at the front of the list. |
Position |
insertLast(Object e)
Inserts and element at the back of the list. |
boolean |
isEmpty()
Returns whether the list is empty. |
Position |
last()
Returns the last node in the list. |
Position |
next(Position p)
Returns the node after a given node in the list. |
Iterator |
positions()
Returns an iterator of all the nodes in the list. |
Position |
prev(Position p)
Returns the node before a given node in the list. |
Object |
remove(Position p)
Removes a node from the list. |
Object |
replace(Position p,
Object e)
Replaces the element stored at the given node. |
int |
size()
Returns the number of elements in this list. |
Method Detail |
public int size()
public boolean isEmpty()
public Position first()
public Position last()
public Position next(Position p) throws InvalidPositionException, BoundaryViolationException
InvalidPositionException
BoundaryViolationException
public Position prev(Position p) throws InvalidPositionException, BoundaryViolationException
InvalidPositionException
BoundaryViolationException
public Position insertFirst(Object e)
public Position insertLast(Object e)
public Position insertAfter(Position p, Object e) throws InvalidPositionException
InvalidPositionException
public Position insertBefore(Position p, Object e) throws InvalidPositionException
InvalidPositionException
public Object remove(Position p) throws InvalidPositionException
InvalidPositionException
public Object replace(Position p, Object e) throws InvalidPositionException
InvalidPositionException
public Iterator positions()
public Iterator elements()
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |