|
||||||||||
| 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 in [min,max]. |
|
DiscreteAlphabet(String[] alphabet,
boolean caseInsensitive)
Constructor for a discrete alphabet. |
|
DiscreteAlphabet(StringBuffer representation)
Extracts the alphabet from the StringBuffer. |
|
| Method Summary | |
|---|---|
int |
compareTo(Alphabet b)
|
int |
getCode(String symbol)
Returns the code of a given symbol. |
Alphabet.AlphabetParameterSet |
getCurrentParameterSet()
Returns the InstanceParameterSet that has been used to instantiate the current instance of the implementing
class. |
int |
getMaximalSymbolLength()
Returns the length of the longest "symbol" in the alphabet. |
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)
Tests if a given symbol is contained in the alphabet. |
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
StringBuffer.
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 - if true then there will be no difference between
lowercase and uppercase letters/symbols in the alphabet (no
case sensivity)
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
InstantiableFromParameterSetInstanceParameterSet 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.
InstanceParameterSet
Exception - is thrown if the InstanceParameterSet 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 is not defined in the alphabetpublic final int getMaximalSymbolLength()
public double getMin()
Alphabet
getMin in class Alphabetpublic final String getSymbolAt(int i)
i in the alphabet.
i - the position in the alphabet
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 | |||||||||