datastructures

net.datastructures
Interface Sequence

All Superinterfaces:
List, Vector
All Known Implementing Classes:
NodeSequence

public interface Sequence
extends List, Vector

An interface for a sequence, a data structure supporting all operations of a vector and a list.

Author:
Roberto Tamassia, Michael Goodrich

Method Summary
 Position atRank(int r)
          Returns the position containing the element at the given rank.
 int rankOf(Position p)
          Returns the rank of the element stored at the given position.
 
Methods inherited from interface net.datastructures.List
elements, first, insertAfter, insertBefore, insertFirst, insertLast, isEmpty, last, next, positions, prev, remove, replace, size
 
Methods inherited from interface net.datastructures.Vector
elemAtRank, insertAtRank, isEmpty, removeAtRank, replaceAtRank, size
 

Method Detail

atRank

public Position atRank(int r)
                throws BoundaryViolationException
Returns the position containing the element at the given rank.

Throws:
BoundaryViolationException

rankOf

public int rankOf(Position p)
           throws InvalidPositionException
Returns the rank of the element stored at the given position.

Throws:
InvalidPositionException

datastructures