de.jstacs.data.alphabets
Class ComplementableDiscreteAlphabet
java.lang.Object
de.jstacs.data.Alphabet
de.jstacs.data.alphabets.DiscreteAlphabet
de.jstacs.data.alphabets.ComplementableDiscreteAlphabet
- All Implemented Interfaces:
- InstantiableFromParameterSet, Storable, Comparable<Alphabet>
- Direct Known Subclasses:
- DNAAlphabet
public abstract class ComplementableDiscreteAlphabet
- extends DiscreteAlphabet
This abstract class indicates that an alphabet can be used to compute the
complement. The most important method is getComplementaryCode(int).
- Author:
- Jan Grau, Jens Keilwagen
| Methods inherited from class de.jstacs.data.alphabets.DiscreteAlphabet |
compareTo, getCode, getMaximalSymbolLength, getMin, getSymbolAt, ignoresCase, isEncodedSymbol, isSymbol, length, toString, toXML |
ComplementableDiscreteAlphabet
protected ComplementableDiscreteAlphabet(StringBuffer representation)
throws NonParsableException
- The constructor for the
Storable interface.
- Parameters:
representation - the XML representation
- Throws:
NonParsableException - if the stream is not parsable
ComplementableDiscreteAlphabet
protected ComplementableDiscreteAlphabet(String[] alphabet,
boolean caseInsensitive)
throws DoubleSymbolException,
IllegalArgumentException
- The main constructor.
- Parameters:
alphabet - the array of symbolscaseInsensitive - if true then there will be no difference between
lowercase and uppercase letters/symbols in the alphabet (no
case sensivity)
- Throws:
DoubleSymbolException - if a symbol occurs more than once in the alphabet
IllegalArgumentException - if one of the symbols is either empty or a white-space
character
getCurrentParameterSet
public abstract Alphabet.AlphabetParameterSet getCurrentParameterSet()
throws Exception
- Description copied from interface:
InstantiableFromParameterSet
- Returns the
InstanceParameterSet that has been used to instantiate the current instance of the implementing
class. If the current instance was not created using a InstanceParameterSet, an equivalent
InstanceParameterSet should be returned, such that an instance created using this
InstanceParameterSet would be in principle equal to the current instance.
- Specified by:
getCurrentParameterSet in interface InstantiableFromParameterSet- Overrides:
getCurrentParameterSet in class DiscreteAlphabet
- Returns:
- the current
InstanceParameterSet
- Throws:
Exception - is thrown if the InstanceParameterSet could not be returned
getComplementaryCode
public abstract int getComplementaryCode(int code)
- This method returns the code of the symbol that is the complement of the
symbol encoded by
code.
- Parameters:
code - the encoded symbol
- Returns:
- the code of the complement