Class ListAlphabet<I>

    • Constructor Detail

      • ListAlphabet

        public ListAlphabet​(List<? extends I> list)
    • Method Detail

      • getSymbol

        public I getSymbol​(int index)
        Description copied from interface: Alphabet
        Returns the symbol with the given index in this alphabet.
        Parameters:
        index - the index of the requested symbol.
        Returns:
        symbol with the given index.
      • getSymbolIndex

        public int getSymbolIndex​(I symbol)
        Description copied from interface: Alphabet
        Returns the index of the given symbol in the alphabet.
        Parameters:
        symbol - the symbol whose index should be determined
        Returns:
        the index of the given symbol
      • containsSymbol

        public boolean containsSymbol​(I symbol)
        Description copied from interface: Alphabet
        Checks whether the given symbol is part of the alphabet.

        Caution: the default implementation is rather inefficient and should be overridden, if possible.

        Parameters:
        symbol - the symbol to check
        Returns:
        true iff the symbol is part of the alphabet