public abstract class ComplementableDiscreteAlphabet extends DiscreteAlphabet
getComplementaryCode(int)
.DiscreteAlphabet.DiscreteAlphabetParameterSet
Alphabet.AlphabetParameterSet<T extends Alphabet>
alphabet, caseInsensitive, parameters
Modifier | Constructor and Description |
---|---|
protected |
ComplementableDiscreteAlphabet(boolean caseInsensitive,
String... alphabet)
Creates a new
ComplementableDiscreteAlphabet from a given array
of symbols. |
protected |
ComplementableDiscreteAlphabet(DiscreteAlphabet.DiscreteAlphabetParameterSet parameters)
The constructor for the
InstantiableFromParameterSet
interface. |
protected |
ComplementableDiscreteAlphabet(StringBuffer representation)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
abstract int |
getComplementaryCode(int code)
This method returns the code of the symbol that is the complement of the
symbol encoded by
code . |
compareTo, getCode, getCurrentParameterSet, getMaximalSymbolLength, getMin, getSymbolAt, ignoresCase, isEncodedSymbol, isSymbol, length, toString, toXML
checkConsistency
protected ComplementableDiscreteAlphabet(DiscreteAlphabet.DiscreteAlphabetParameterSet parameters) throws IllegalArgumentException, DoubleSymbolException
InstantiableFromParameterSet
interface. Creates a new ComplementableDiscreteAlphabet
from a given set of
parameters.parameters
- the parameter set for the ComplementableDiscreteAlphabet
IllegalArgumentException
- if space or tab will be used as symbolsDoubleSymbolException
- if one of the symbols occurred more than onceInstantiableFromParameterSet
protected ComplementableDiscreteAlphabet(StringBuffer representation) throws NonParsableException
Storable
.
Creates a new ComplementableDiscreteAlphabet
out of its XML
representation.representation
- the XML representation as StringBuffer
NonParsableException
- if the ComplementableDiscreteAlphabet
could not be
reconstructed out of the XML representation (the
StringBuffer
representation
could not be
parsed)DiscreteAlphabet.DiscreteAlphabet(StringBuffer)
,
Storable
protected ComplementableDiscreteAlphabet(boolean caseInsensitive, String... alphabet) throws DoubleSymbolException, IllegalArgumentException
ComplementableDiscreteAlphabet
from a given array
of symbols.alphabet
- the array of symbolscaseInsensitive
- indicates if there will be no difference between lowercase and
uppercase letters/symbols in the alphabet (no case sensitivity)DoubleSymbolException
- if a symbol occurs more than once in the alphabetIllegalArgumentException
- if one of the symbols is either empty or a white-space
characterDiscreteAlphabet.DiscreteAlphabet(boolean, String...)