/** An interface for objects for which comparison by lexicographical order is sensible. The objects are assumed to be sequences of elements drawn from a fixed finite sets called an alphabet. Often the same alphabet is used for each position in the sequence, but this is not required by the interface. Alphabets are assumed to be ordered, so that one may speak of the 0th, 1st, etc., elements of the alphabet. The 0th element is assumed to be a terminator, to be returned for example when seeking the kth element of a string of length k-1 or k-2. However, no ordering methods are assumed either for the objects themselves, or for the members of their underlying alphabets. Lexicographical objects are assumed to know the size of the alphabet from which they are composed. The interface provides a method to access this value. If there are different alphabets for different positions of the sequence, then the maximum of these alphabet sizes is to be returned -- there is no provision for finding the alphabet size at a given position. */ public interface Lexicographical { /** @return the number of elements in the Lexicographical object */ public int length(); /** @param i a position in a lexicographical object @return an integer code representing the character at position i. Assumes that positions start at 0. Returns 0 if there is no character at the given position. */ public int elementAt(int i); /** @return the number of distinct characters in the alphabet, including the terminator character. */ public int getAlphabetSize(); };