jdsl.core.api
Interface Position

All Known Subinterfaces:
Edge, Vertex
All Known Implementing Classes:
MutablePosition, jdsl.core.ref.SILPosition, SequencePosition, GenericPosition, Node

public abstract interface Position

Interface for a position. A position formalizes the intuitive notion of the "place" where an element is stored in a positional container (sequence, tree, graph). A node of a tree and a vertex of a graph are examples of positions.

Author:
Michael T. Goodrich, Mark Handy, Roberto Tamassia
See Also:
PositionalContainer, InvalidPositionException

Method Summary
 Container container()
          Return the container holding this position.
 java.lang.Object element()
          Return the element stored at this position.
 

Method Detail

element

public java.lang.Object element()
                         throws InvalidPositionException
Return the element stored at this position.

An InvalidPositionException is thrown if the position is invalid because it was removed from its container.

Returns:
element stored at this position

container

public Container container()
                    throws InvalidPositionException
Return the container holding this position.

An InvalidPositionException is thrown if the position is invalid because it was removed from its container.

Returns:
container holding this position.