net.datastructures
Interface Sequence<E>
- All Superinterfaces:
- Deque<E>, IndexList<E>, java.lang.Iterable<E>, PositionList<E>
public interface Sequence<E>
- extends Deque<E>, IndexList<E>, PositionList<E>
An interface for a sequence, a data structure supporting all operations of a
deque, indexed list and position list. //end#fragment Sequence
- Author:
- Roberto Tamassia, Michael Goodrich //begin#fragment Sequence
Method Summary |
Position<E> |
atIndex(int r)
Returns the position containing the element at the given index. |
int |
indexOf(Position<E> p)
Returns the index of the element stored at the given position. |
Methods inherited from interface net.datastructures.PositionList |
addAfter, addBefore, addFirst, addLast, first, isEmpty, iterator, last, next, positions, prev, remove, set, size |
atIndex
Position<E> atIndex(int r)
throws BoundaryViolationException
- Returns the position containing the element at the given index.
- Throws:
BoundaryViolationException
indexOf
int indexOf(Position<E> p)
throws InvalidPositionException
- Returns the index of the element stored at the given position.
- Throws:
InvalidPositionException