|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Please refer to the documentation of Sequence
.
InspectablePositionalContainer
Method Summary | |
Position |
after(Position p)
The next position in the sequence. |
Position |
atRank(int rank)
Get the position in the sequence with the specified rank |
Position |
before(Position p)
The previous position in the sequence. |
Position |
first()
The first position of the sequence. |
boolean |
isFirst(Position p)
Check if the given position is the first. |
boolean |
isLast(Position p)
Check if the given position is the last. |
Position |
last()
The last position of the sequence. |
int |
rankOf(Position p)
Get the rank of a given position. |
Methods inherited from interface jdsl.core.api.InspectablePositionalContainer |
positions |
Methods inherited from interface jdsl.core.api.InspectableContainer |
contains, elements, isEmpty, size |
Method Detail |
public Position first() throws EmptyContainerException
EmptyContainerException
- if this sequence is emptypublic Position last() throws EmptyContainerException
EmptyContainerException
- if this sequence is emptypublic boolean isFirst(Position p) throws InvalidAccessorException
p
- A Position in this sequence
InvalidAccessorException
- Thrown if p
is
not a valid position in this sequencepublic boolean isLast(Position p) throws InvalidAccessorException
p
- A Position in this sequenceInvalidAccessorException
- Thrown if p
is
not a valid position in this sequencepublic Position before(Position p) throws BoundaryViolationException, InvalidAccessorException
p
- A Position in this sequence
p
InvalidAccessorException
- Thrown if p
is
not a valid position in this sequence
BoundaryViolationException
- if p is the first position of
this sequence.public Position after(Position p) throws BoundaryViolationException, InvalidAccessorException
p
- A Position in this sequence.
p
InvalidAccessorException
- Thrown if p
is
not a valid position in this sequence
BoundaryViolationException
- if p is the last position of
this sequence.public Position atRank(int rank) throws BoundaryViolationException
rank
- An integer index of positions in the sequence; the
Position
returned by first()
is the
same as that returned by atRank(0)
last() is the same as that returned by
atRank(size() - 1)
.
BoundaryViolationException
- if rank<0 or rank>=size()public int rankOf(Position p) throws InvalidAccessorException
p
- A Position in this sequence
size() - 1
.
InvalidAccessorException
- if p
is
not a valid position in this sequence
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |