|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for a positional sequence. A positional sequence is a positional container whose positions are linearly arranged and that supports position-based operations. It is a generalization of a linked list.
The enumerations returned by methods Container.elements() and PositionalContainer.positions() are guaranteed to give the elements/position in the same order as they are arranged in the positional sequence.
Sequence,
Position,
PositionalContainer| Method Summary | |
Position |
after(Position p)
Return the position immediately after the specified one. |
Position |
before(Position p)
Return the position immediately before the specified one. |
Position |
first()
Return the first position. |
Position |
insertAfter(Position p,
java.lang.Object element)
Create a new position immediately after the specified position and store there the given element. |
Position |
insertBefore(Position p,
java.lang.Object element)
Create a new position immediately before the specified position and store there the given element. |
Position |
insertFirst(java.lang.Object element)
Create a new position at the beginning of the positional sequence and store there the given element. |
Position |
insertLast(java.lang.Object element)
Create a new position at the end of the positional sequence and store there the given element. |
Position |
last()
Return the last position. |
java.lang.Object |
remove(Position p)
Remove and invalidate the specified position. |
java.lang.Object |
removeAfter(Position p)
Removes the position after a specified position |
java.lang.Object |
removeBefore(Position p)
Removes the position before a specified position |
java.lang.Object |
removeFirst()
Removes the first position in the sequence |
java.lang.Object |
removeLast()
Removes the last position of the sequence |
| Methods inherited from interface jdsl.core.api.PositionalContainer |
positions,
replace,
swap |
| Methods inherited from interface jdsl.core.api.Container |
elements,
newContainer |
| Methods inherited from interface jdsl.simple.api.SimpleContainer |
isEmpty,
size |
| Method Detail |
public Position first()
throws EmptyContainerException
An EmptyContainerException is thrown if the positional sequence is empty.
public Position last()
throws EmptyContainerException
An EmptyContainerException is thrown if the positional sequence is empty.
public Position before(Position p)
throws InvalidPositionException,
BoundaryViolationException
A BoundaryViolationException is thrown if the position specified is the first one.
p - position.
public Position after(Position p)
throws InvalidPositionException,
BoundaryViolationException
A BoundaryViolationException is thrown if the position specified is the last one.
p - position.public Position insertFirst(java.lang.Object element)
element - element to be inserted.public Position insertLast(java.lang.Object element)
element - element to be inserted.
public Position insertBefore(Position p,
java.lang.Object element)
throws InvalidPositionException
p - position immediately before which the insertion should be done.element - element to be inserted.
public Position insertAfter(Position p,
java.lang.Object element)
throws InvalidPositionException
p - position immediately after which the insertion should be done.element - element to be inserted.
public java.lang.Object remove(Position p)
throws InvalidPositionException
p - position to be removed.
public java.lang.Object removeBefore(Position p)
throws InvalidPositionException,
BoundaryViolationException
p - Position after position to be removed
public java.lang.Object removeAfter(Position p)
throws InvalidPositionException,
BoundaryViolationException
p - Position before position to be removed
public java.lang.Object removeFirst()
throws EmptyContainerException
public java.lang.Object removeLast()
throws EmptyContainerException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||