jdsl.core.api
Interface InspectableCircularSequence

All Superinterfaces:
InspectableContainer, InspectablePositionalContainer
All Known Subinterfaces:
CircularSequence

public interface InspectableCircularSequence
extends InspectablePositionalContainer

Please refer to the documentation of CircularSequence.

Version:
$Id: InspectableCircularSequence.java,v 1.5 1999/07/30 16:25:15 mgb Exp $
Author:
Luca Vismara (lv), Mark Handy (mdh)
See Also:
CircularSequence

Method Summary
 Position after(Position p)
          Find the position after the given one
 Position before(Position p)
          Find the position before the given one
 Position startingPosition()
          Gives a position from the circular sequence without any guarantee about what position is returned.
 
Methods inherited from interface jdsl.core.api.InspectablePositionalContainer
positions
 
Methods inherited from interface jdsl.core.api.InspectableContainer
contains, elements, isEmpty, size
 

Method Detail

before

public Position before(Position p)
                throws InvalidAccessorException
Find the position before the given one
Parameters:
p - Position in this sequence
Returns:
Position of previous element
Throws:
InvalidAccessorException - if p is not a valid position in this circular sequence.

after

public Position after(Position p)
               throws InvalidAccessorException
Find the position after the given one
Parameters:
p - Position in this sequence
Returns:
Position of next element
Throws:
InvalidAccessorException - if p is not a valid position in this circular sequence.

startingPosition

public Position startingPosition()
                          throws EmptyContainerException
Gives a position from the circular sequence without any guarantee about what position is returned. Since there is no concept of a first or last position in a circular sequence, a method is needed that will give a position -- any position -- in the circular sequence.
Returns:
An arbitrary position in the circular sequence
Throws:
EmptyContainerException - if there are no elements in this circular sequence