|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.data.Alphabet
de.jstacs.data.alphabets.DiscreteAlphabet
public class DiscreteAlphabet
Class for an alphabet that consists of arbitrary Strings. For DNA-alphabets, the class DNAAlphabet should be used;
| Nested Class Summary | |
|---|---|
static class |
DiscreteAlphabet.DiscreteAlphabetParameterSet
Class for the ParameterSet of a DiscreteAlphabet. |
| Nested classes/interfaces inherited from class de.jstacs.data.Alphabet |
|---|
Alphabet.AlphabetParameterSet |
| Field Summary | |
|---|---|
protected Alphabet.AlphabetParameterSet |
parameters
The ParameterSet describing this DiscreteAlphabet |
| Constructor Summary | |
|---|---|
DiscreteAlphabet(DiscreteAlphabet.DiscreteAlphabetParameterSet parameters)
The constructor for the InstantiableFromParameterSet interface. |
|
DiscreteAlphabet(int min,
int max)
Constructor for a discrete alphabet [min,max]. |
|
DiscreteAlphabet(String[] alphabet,
boolean caseInsensitive)
Constructor for an discrete alphabet. |
|
DiscreteAlphabet(StringBuffer representation)
Extracts the alphabet from the StringBuffer. |
|
| Method Summary | |
|---|---|
int |
compareTo(Alphabet b)
|
int |
getCode(String symbol)
|
Alphabet.AlphabetParameterSet |
getCurrentParameterSet()
Returns the ParameterSet that has been used to instantiate the current instance of the implementing
class. |
int |
getMaximalSymbolLength()
|
double |
getMin()
Returns the minimal value. |
String |
getSymbolAt(int i)
Returns the symbol at Position i in the alphabet |
boolean |
ignoresCase()
If this method returns true the alphabet ignores the case. |
boolean |
isEncodedSymbol(int candidate)
Returns true if candidate is an element of the internal interval. |
boolean |
isSymbol(String candidat)
|
double |
length()
Returns the number of Symbols in the calling alphabet |
String |
toString()
|
StringBuffer |
toXML()
This method returns an XML-representation of an instance of the implementing class. |
| Methods inherited from class de.jstacs.data.Alphabet |
|---|
checkConsistency |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Alphabet.AlphabetParameterSet parameters
ParameterSet describing this DiscreteAlphabet
| Constructor Detail |
|---|
public DiscreteAlphabet(StringBuffer representation)
throws NonParsableException
representation - the XML stream
NonParsableException - if the stream is not parsable
public DiscreteAlphabet(DiscreteAlphabet.DiscreteAlphabetParameterSet parameters)
throws IllegalArgumentException,
DoubleSymbolException
InstantiableFromParameterSet interface.
parameters - the ParameterSet
IllegalArgumentException - is thrown if space or tab will be used as symbols
DoubleSymbolException - is thrown if one of the symbols occurred more than once
public DiscreteAlphabet(int min,
int max)
throws IllegalArgumentException
[min,max].
min - the minimal value (inclusive)max - the maximal value (inclusive)
IllegalArgumentException - is thrown if min>max
public DiscreteAlphabet(String[] alphabet,
boolean caseInsensitive)
throws DoubleSymbolException,
IllegalArgumentException
String array is cloned internally
alphabet - the alphabet as String arraycaseInsensitive -
DoubleSymbolException - is thrown if one of the symbols occurred more than once
IllegalArgumentException - is thrown if one of the symbols is either empty or a white-space character| Method Detail |
|---|
public Alphabet.AlphabetParameterSet getCurrentParameterSet()
throws Exception
InstantiableFromParameterSetParameterSet that has been used to instantiate the current instance of the implementing
class. If the current instance was not created using a ParameterSet, an equivalent
ParameterSet should be returned, such that an instance created using this
ParameterSet would be in principle equal to the current instance.
ParameterSet
Exception - is thrown if the ParameterSet could not be returnedpublic StringBuffer toXML()
Storable
public int compareTo(Alphabet b)
public final int getCode(String symbol)
throws WrongAlphabetException
symbol - the symbol
WrongAlphabetException - if the symbol can not be encodedpublic final int getMaximalSymbolLength()
public double getMin()
Alphabet
getMin in class Alphabetpublic final String getSymbolAt(int i)
i in the alphabet
i - the position
public final boolean ignoresCase()
true the alphabet ignores the case.
true if the alphabet ignores the casepublic final boolean isEncodedSymbol(int candidate)
true if candidate is an element of the internal interval.
candidate - the value to be tested
true if candidate is an element of the internal intervalpublic final boolean isSymbol(String candidat)
candidat - the candidat symbol
true if the candidat is a symbol of the alphabetpublic final double length()
length in class Alphabetpublic String toString()
toString in class Alphabet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||