// Textbook fragment 06.18 /** * An interface for a sequence, a data structure supporting all * operations of a deque, indexed list and position list. */ public interface Sequence extends Deque, IndexList, PositionList { /** Returns the position containing the element at the given index. */ public Position atIndex(int r) throws BoundaryViolationException; /** Returns the index of the element stored at the given position. */ public int indexOf(Position p) throws InvalidPositionException; }