de.jstacs.data.alphabets
Class ContinuousAlphabet

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

public class ContinuousAlphabet
extends Alphabet

Class for a continuous alphabet.

Author:
Jens Keilwagen

Nested Class Summary
static class ContinuousAlphabet.ContinuousAlphabetParameterSet
          Class for the ParameterSet of a ContinuousAlphabet.
 
Nested classes/interfaces inherited from class de.jstacs.data.Alphabet
Alphabet.AlphabetParameterSet
 
Constructor Summary
ContinuousAlphabet(ContinuousAlphabet.ContinuousAlphabetParameterSet parameters)
          The constructor for the InstantiableFromParameterSet interface.
ContinuousAlphabet(double min, double max)
          Creates a new ContinuousAlphabet from a minimum and a maximum value
ContinuousAlphabet(StringBuffer xml)
          Extracts the alphabet from the StringBuffer.
 
Method Summary
 int compareTo(Alphabet a)
           
 ContinuousAlphabet.ContinuousAlphabetParameterSet getCurrentParameterSet()
          Returns the ParameterSet that has been used to instantiate the current instance of the implementing class.
 double getMax()
          Returns the maximal value of this alphabet.
 double getMin()
          Returns the minimal value.
 boolean isEncodedSymbol(double candidat)
          Returns true if candidat is an element of the internal interval.
 double length()
          Returns the length of the 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
 

Constructor Detail

ContinuousAlphabet

public ContinuousAlphabet(ContinuousAlphabet.ContinuousAlphabetParameterSet parameters)
The constructor for the InstantiableFromParameterSet interface.

Parameters:
parameters - the ParameterSet

ContinuousAlphabet

public ContinuousAlphabet(double min,
                          double max)
                   throws IllegalArgumentException
Creates a new ContinuousAlphabet from a minimum and a maximum value

Parameters:
min - the minimum
max - the maximum
Throws:
IllegalArgumentException - is thrown if minimum or maximum could not be set

ContinuousAlphabet

public ContinuousAlphabet(StringBuffer xml)
                   throws NonParsableException
Extracts the alphabet from the StringBuffer.

Parameters:
xml - the XML stream
Throws:
NonParsableException - if the stream is not parsable
Method Detail

getCurrentParameterSet

public ContinuousAlphabet.ContinuousAlphabetParameterSet getCurrentParameterSet()
                                                                         throws Exception
Description copied from interface: InstantiableFromParameterSet
Returns the ParameterSet 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.

Returns:
the current ParameterSet
Throws:
Exception - is thrown if the ParameterSet could not be returned

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML-representation of an instance of the implementing class.

Returns:
the XML-representation

compareTo

public int compareTo(Alphabet a)

getMin

public double getMin()
Description copied from class: Alphabet
Returns the minimal value.

Specified by:
getMin in class Alphabet
Returns:
the minimal value

getMax

public double getMax()
Returns the maximal value of this alphabet.

Returns:
the maximal value of this alphabet

isEncodedSymbol

public final boolean isEncodedSymbol(double candidat)
Returns true if candidat is an element of the internal interval.

Parameters:
candidat - the value to be tested
Returns:
true if candidat is an element of the internal interval

length

public double length()
Description copied from class: Alphabet
Returns the length of the alphabet.

Specified by:
length in class Alphabet
Returns:
the length of the alphabet

toString

public String toString()
Specified by:
toString in class Alphabet