Class EnumAlphabet<E extends Enum<E>>

    • Constructor Detail

      • EnumAlphabet

        public EnumAlphabet​(Class<E> enumClazz,
                            boolean withNull)
    • Method Detail

      • getSymbolIndex

        public int getSymbolIndex​(E symbol)
        Description copied from interface: Alphabet
        Returns the index of the given symbol in the alphabet.
        Specified by:
        getSymbolIndex in interface Alphabet<E extends Enum<E>>
        Overrides:
        getSymbolIndex in class ArrayAlphabet<E extends Enum<E>>
        Parameters:
        symbol - the symbol whose index should be determined
        Returns:
        the index of the given symbol
      • containsSymbol

        public boolean containsSymbol​(E 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.

        Specified by:
        containsSymbol in interface Alphabet<E extends Enum<E>>
        Overrides:
        containsSymbol in class ArrayAlphabet<E extends Enum<E>>
        Parameters:
        symbol - the symbol to check
        Returns:
        true iff the symbol is part of the alphabet
      • compare

        public int compare​(E o1,
                           E o2)