|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.core.ref.NodeSequence
This class implements the sequence interface using a double-linked list of nodes.
| Constructor Summary | |
NodeSequence()
|
|
| Method Summary | |
Position |
after(Position p)
Return position after this one |
Position |
atRank(int rank)
Return the position at the given rank |
Position |
before(Position p)
Return position before this one |
java.util.Enumeration |
elements()
Returns an enumeration of the elements in this sequence |
Position |
first()
Return the first position in the sequence |
Position |
insertAfter(Position p,
java.lang.Object element)
Create a new position with the given element and insert it after the given position, returning a reference the new position |
Position |
insertAtRank(int rank,
java.lang.Object element)
Create a new position with the given element and insert it at the given rank. |
Position |
insertBefore(Position p,
java.lang.Object element)
Create a new position with the given element and insert it before the given position, returning a reference to the new node |
Position |
insertFirst(java.lang.Object element)
Create a new position with the given element and insert it as the first position in the sequence. |
Position |
insertLast(java.lang.Object element)
Create a new position with the given element and insert it as the last position in the sequence. |
boolean |
isEmpty()
Return true iff the sequence is empty |
Position |
last()
Return the last position in the sequence |
Container |
newContainer()
Make a new container of this type |
java.util.Enumeration |
positions()
Returns an enumeration of the positions in this sequence |
int |
rankOf(Position p)
Return the rank of the given position |
java.lang.Object |
remove(Position p)
Remove this position from the sequence |
java.lang.Object |
removeAfter(Position p)
Removes after p |
java.lang.Object |
removeAtRank(int i)
Removes the position at rank i |
java.lang.Object |
removeBefore(Position p)
Removes before p |
java.lang.Object |
removeFirst()
Removes the first position |
java.lang.Object |
removeLast()
Removes the last position |
java.lang.Object |
replace(Position p,
java.lang.Object element)
Replace the element of the given position with the new element and return the old value of element |
int |
size()
Return the number of elements in the sequence |
void |
swap(Position a,
Position b)
Swap elements of two positions |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public NodeSequence()
| Method Detail |
public Position first()
throws EmptyContainerException
public Position last()
throws EmptyContainerException
public Position atRank(int rank)
throws BoundaryViolationException
public Position before(Position p)
throws InvalidPositionException,
BoundaryViolationException
public Position after(Position p)
throws InvalidPositionException,
BoundaryViolationException
public int rankOf(Position p)
throws InvalidPositionException
public Position insertBefore(Position p,
java.lang.Object element)
throws InvalidPositionException
public Position insertAfter(Position p,
java.lang.Object element)
throws InvalidPositionException
public Position insertFirst(java.lang.Object element)
public Position insertLast(java.lang.Object element)
public Position insertAtRank(int rank,
java.lang.Object element)
throws BoundaryViolationException
public java.lang.Object remove(Position p)
throws InvalidPositionException
public int size()
public boolean isEmpty()
public Container newContainer()
public java.util.Enumeration elements()
public java.util.Enumeration positions()
public java.lang.Object replace(Position p,
java.lang.Object element)
throws InvalidPositionException
public void swap(Position a,
Position b)
throws InvalidPositionException
public java.lang.Object removeAtRank(int i)
public java.lang.Object removeBefore(Position p)
public java.lang.Object removeAfter(Position p)
public java.lang.Object removeFirst()
public java.lang.Object removeLast()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||