|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InspectableSequence
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 nz.ac.waikato.jdsl.core.api.InspectablePositionalContainer |
---|
positions |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableContainer |
---|
contains, elements, isEmpty, size |
Method Detail |
---|
Position first() throws EmptyContainerException
EmptyContainerException
- if this sequence is emptyPosition last() throws EmptyContainerException
EmptyContainerException
- if this sequence is emptyboolean isFirst(Position p) throws InvalidAccessorException
p
- A Position in this sequence
InvalidAccessorException
- Thrown if p
is
not a valid position in this sequenceboolean isLast(Position p) throws InvalidAccessorException
p
- A Position in this sequenceInvalidAccessorException
- Thrown if p
is
not a valid position in this sequencePosition 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.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.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()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 |