rcf.core.util.position
Interface ImmutablePosition<T>

Type Parameters:
T - The type of the elements which are stored at positions in the backing abstract data structure.
All Superinterfaces:
ImmutableSingletonInterface<T>
All Known Subinterfaces:
ImmutableIterator<T>, Iterator<T>, Position<T>
All Known Implementing Classes:
ImmutablePair.Iterator, ImmutableSingleton.Iterator, ImmutableTriple.Iterator, Pair.Iterator, Singleton.Iterator, Triple.Iterator

@Revision(value="$Revision: 1.6 $",
          date="$Date: 2006/12/16 17:53:21 $",
          tag="$Name:  $")
public interface ImmutablePosition<T>
extends ImmutableSingletonInterface<T>

The simplest kind of immutable position representing an element in an abstract data structure. This interface implies no spatial relationships and no accessor methods beyond ImmutableSingletonInterface.get(). See the package level documentation rcf.core.util.position for more information about positions.

TODO: Javadoc review, Seal/Finalize

Version:
$Revision: 1.6 $
Author:
Greg Gibeling

Method Summary
 boolean equals(Object o)
          Determine if the specified object is an instance of ImmutablPposition which represents the same position in the same abstract data structure, as this object.
 boolean isCompatible(ImmutablePosition<T> p)
          Determine if this position is compatible to, i.e.
 boolean isSentinel()
          Determine if this position is a sentinel; i.e.
 
Methods inherited from interface rcf.core.util.groups.ImmutableSingletonInterface
get
 

Method Detail

equals

boolean equals(Object o)
Determine if the specified object is an instance of ImmutablPposition which represents the same position in the same abstract data structure, as this object. Notice that for positions p and q, p.equals(q) implies p.isCompatible(q) && q.isCompatible(p).

Overrides:
equals in class Object
Parameters:
o - The object to compare this one to, for equality.
Returns:
true if this position and the one specified represent the same position, in the same abstract data structure.

isCompatible

boolean isCompatible(ImmutablePosition<T> p)
Determine if this position is compatible to, i.e. indicates a position in the same abstract data structure as, the specfied position (should return true even for sentinel positions). This method should never throw exceptions (especially IncompatiblePositionException) as it is a test to avoid them.

Parameters:
p - The position to determine if this one is compatible to.
Returns:
true indicates that this position and the specified one belong to the same abstract data structure.

isSentinel

boolean isSentinel()
Determine if this position is a sentinel; i.e. a position which does not contain an element in the backing abstract data structure, but which instead marks the start or end of an iteration or some other boundary condition.

Returns:
true if this is a sentinel position.