Class SingletonAlphabet

    • Method Detail

      • getAlphabets

        public java.util.List getAlphabets()
        Description copied from interface: Alphabet
        Return an ordered List of the alphabets which make up a compound alphabet. For simple alphabets, this will return a singleton list of itself. The returned list should be immutable.
        Specified by:
        getAlphabets in interface Alphabet
        Returns:
        a List of alphabets
      • getName

        public java.lang.String getName()
        Description copied from interface: Alphabet
        Get the name of the alphabet.
        Specified by:
        getName in interface Alphabet
        Returns:
        the name as a string.
      • getTokenization

        public SymbolTokenization getTokenization​(java.lang.String name)
                                           throws java.util.NoSuchElementException
        Description copied from interface: Alphabet

        Get a SymbolTokenization by name.

        The parser returned is guaranteed to return Symbols and SymbolLists that conform to this alphabet.

        Every alphabet should have a SymbolTokenzation under the name 'token' that uses the symbol token characters to translate a string into a SymbolList. Likewise, there should be a SymbolTokenization under the name 'name' that uses symbol names to identify symbols. Any other names may also be defined, but the behavior of the returned SymbolTokenization is not defined here.

        A SymbolTokenization under the name 'default' should be defined for all sequences, that determines the behavior when printing out a sequence. Standard behavior is to define the 'token' SymbolTokenization as default if it exists, else to define the 'name' SymbolTokenization as the default, but others are possible.

        Specified by:
        getTokenization in interface Alphabet
        Overrides:
        getTokenization in class AbstractAlphabet
        Parameters:
        name - the name of the parser
        Returns:
        a parser for that name
        Throws:
        java.util.NoSuchElementException - if the name is unknown
      • iterator

        public java.util.Iterator iterator()
        Description copied from interface: FiniteAlphabet
        Retrieve an Iterator over the AtomicSymbols in this FiniteAlphabet.

        Each AtomicSymbol as for which this.contains(as) is true will be returned exactly once by this iterator in no specified order.

        Specified by:
        iterator in interface FiniteAlphabet
        Returns:
        an Iterator over the contained AtomicSymbol objects
      • size

        public int size()
        Description copied from interface: FiniteAlphabet
        The number of symbols in the alphabet.
        Specified by:
        size in interface FiniteAlphabet
        Returns:
        the size of the alphabet