|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PositionList<E>
An interface for positional lists.
Method Summary | |
---|---|
void |
addAfter(Position<E> p,
E e)
Inserts an element after the given node in the list. |
void |
addBefore(Position<E> p,
E e)
Inserts an element before the given node in the list. |
void |
addFirst(E e)
Inserts an element at the front of the list, returning new position. |
void |
addLast(E e)
Inserts and element at the back of the list, returning new position. |
Position<E> |
first()
Returns the first node in the list. |
boolean |
isEmpty()
Returns whether the list is empty. |
java.util.Iterator<E> |
iterator()
Returns an iterator of all the elements in the list. |
Position<E> |
last()
Returns the last node in the list. |
Position<E> |
next(Position<E> p)
Returns the node after a given node in the list. |
java.lang.Iterable<Position<E>> |
positions()
Returns an iterable collection of all the nodes in the list. |
Position<E> |
prev(Position<E> p)
Returns the node before a given node in the list. |
E |
remove(Position<E> p)
Removes a node from the list, returning the element stored there. |
E |
set(Position<E> p,
E e)
Replaces the element stored at the given node, returning old element. |
int |
size()
Returns the number of elements in this list. |
Method Detail |
---|
int size()
boolean isEmpty()
Position<E> first()
Position<E> last()
Position<E> next(Position<E> p) throws InvalidPositionException, BoundaryViolationException
InvalidPositionException
BoundaryViolationException
Position<E> prev(Position<E> p) throws InvalidPositionException, BoundaryViolationException
InvalidPositionException
BoundaryViolationException
void addFirst(E e)
void addLast(E e)
void addAfter(Position<E> p, E e) throws InvalidPositionException
InvalidPositionException
void addBefore(Position<E> p, E e) throws InvalidPositionException
InvalidPositionException
E remove(Position<E> p) throws InvalidPositionException
InvalidPositionException
E set(Position<E> p, E e) throws InvalidPositionException
InvalidPositionException
java.lang.Iterable<Position<E>> positions()
java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |