de.jstacs.data.alphabets
Class Alphabet

java.lang.Object
  extended by de.jstacs.data.alphabets.Alphabet
All Implemented Interfaces:
InstantiableFromParameterSet, Storable, Comparable<Alphabet>
Direct Known Subclasses:
ContinuousAlphabet, DiscreteAlphabet

public abstract class Alphabet
extends Object
implements Storable, InstantiableFromParameterSet, Comparable<Alphabet>

Class for a set of symbols, i.e. an Alphabet. All Alphabets are immutable.

Author:
Jens Keilwagen

Nested Class Summary
static class Alphabet.AlphabetParameterSet<T extends Alphabet>
          The super class for the InstanceParameterSet of any Alphabet.
 
Constructor Summary
Alphabet()
           
 
Method Summary
 boolean checkConsistency(Alphabet a)
          Checks if this Alphabet is consistent consistent with another Alphabet, i.e.
abstract  InstanceParameterSet<? extends Alphabet> getCurrentParameterSet()
          Returns the InstanceParameterSet that has been used to instantiate the current instance of the implementing class.
abstract  double getMin()
          Returns the minimal value of theAlphabet.
abstract  double length()
          Returns the length of the Alphabet.
abstract  String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.jstacs.Storable
toXML
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Alphabet

public Alphabet()
Method Detail

checkConsistency

public final boolean checkConsistency(Alphabet a)
Checks if this Alphabet is consistent consistent with another Alphabet, i.e. both Alphabets use the same symbols.

Parameters:
a - the second Alphabet
Returns:
true if the Alphabets are consistent, false otherwise
See Also:
Comparable.compareTo(Object)

getMin

public abstract double getMin()
Returns the minimal value of theAlphabet.

Returns:
the minimal value of the Alphabet

length

public abstract double length()
Returns the length of the Alphabet.

Returns:
the length of the Alphabet

toString

public abstract String toString()
Overrides:
toString in class Object

getCurrentParameterSet

public abstract InstanceParameterSet<? extends Alphabet> 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 an InstanceParameterSet, an equivalent InstanceParameterSet should be returned, so that an instance created using this InstanceParameterSet would be in principle equal to the current instance.

Specified by:
getCurrentParameterSet in interface InstantiableFromParameterSet
Returns:
the current InstanceParameterSet
Throws:
Exception - if the InstanceParameterSet could not be returned