/**
 * The InspectableSequence interface specifies a sequence of elements that 
 * supports access to its elements by their ranks and positions.  The
 * sequence cannot be changed.
 * A rank is invalid if it is smaller than 0 or greater than or equal 
 * to the size of the sequence.
 *
 * @version     1.1    October 12, 1999
 * @author      Franck van Breugel
 */
public interface InspectableSequence extends InspectableVector, InspectableList
{
    /** 
     * Returns the position of the element at the specified rank in this sequence.
     * Throws a BoundaryViolationException if the specified rank is invalid.
     * @param rank The rank of the element, the position of which is to be returned.
     * @return The position of the element at the specified rank in this sequence.
     * @exception BoundaryViolationException If the specified rank is invalid.
     */
    public Position atRank(int rank) throws BoundaryViolationException;

    /**
     * Returns the rank of the element at specified position in this sequence.
     * @param position The position of the element, the rank of which is to be returned.
     * @return The rank of the element at the specified position in this sequence.
     */
    public int rankOf(Position position);
}
