de.jstacs.data.alphabets
Class ContinuousAlphabet

java.lang.Object
  extended by de.jstacs.data.alphabets.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, Jan Grau

Nested Class Summary
static class ContinuousAlphabet.ContinuousAlphabetParameterSet
          Class for the ParameterSet of a ContinuousAlphabet.
 
Nested classes/interfaces inherited from class de.jstacs.data.alphabets.Alphabet
Alphabet.AlphabetParameterSet<T extends Alphabet>
 
Constructor Summary
ContinuousAlphabet()
          Creates a new ContinuousAlphabet with minimum and maximum value being -Double.MAX_VALUE and Double.MAX_VALUE, respectively.
ContinuousAlphabet(boolean allowNaN)
          Creates a new ContinuousAlphabet with minimum and maximum value being -Double.MAX_VALUE and Double.MAX_VALUE, respectively.
ContinuousAlphabet(ContinuousAlphabet.ContinuousAlphabetParameterSet parameters)
          The constructor for the InstantiableFromParameterSet interface.
ContinuousAlphabet(double min, double max)
          Creates a new ContinuousAlphabet from a minimal and a maximal value.
ContinuousAlphabet(double min, double max, boolean allowNaN)
          Creates a new ContinuousAlphabet from a minimal and a maximal value.
ContinuousAlphabet(StringBuffer xml)
          The standard constructor for the interface Storable.
 
Method Summary
 int compareTo(Alphabet a)
           
 ContinuousAlphabet.ContinuousAlphabetParameterSet getCurrentParameterSet()
          Returns the InstanceParameterSet 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 of theAlphabet.
 boolean isEncodedSymbol(double candidat)
          Indicates 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 as StringBuffer of an instance of the implementing class.
 
Methods inherited from class de.jstacs.data.alphabets.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. Creates a new ContinuousAlphabet from a given set of parameters.

Parameters:
parameters - the parameter set for the ContinuousAlphabet
See Also:
InstantiableFromParameterSet

ContinuousAlphabet

public ContinuousAlphabet(double min,
                          double max)
                   throws IllegalArgumentException
Creates a new ContinuousAlphabet from a minimal and a maximal value. NaN values are not allowed.

Parameters:
min - the minimal value
max - the maximal value
Throws:
IllegalArgumentException - if the minimum or the maximum could not be set

ContinuousAlphabet

public ContinuousAlphabet(double min,
                          double max,
                          boolean allowNaN)
                   throws IllegalArgumentException
Creates a new ContinuousAlphabet from a minimal and a maximal value.

Parameters:
min - the minimal value
max - the maximal value
allowNaN - true if NaN values are allowed
Throws:
IllegalArgumentException - if the minimum or the maximum could not be set

ContinuousAlphabet

public ContinuousAlphabet()
Creates a new ContinuousAlphabet with minimum and maximum value being -Double.MAX_VALUE and Double.MAX_VALUE, respectively. NaN values are not allowed.

Throws:
IllegalArgumentException - if the minimum or the maximum could not be set
See Also:
ContinuousAlphabet(double, double)

ContinuousAlphabet

public ContinuousAlphabet(boolean allowNaN)
Creates a new ContinuousAlphabet with minimum and maximum value being -Double.MAX_VALUE and Double.MAX_VALUE, respectively.

Parameters:
allowNaN - true if NaN values are allowed
Throws:
IllegalArgumentException - if the minimum or the maximum could not be set
See Also:
ContinuousAlphabet(double, double)

ContinuousAlphabet

public ContinuousAlphabet(StringBuffer xml)
                   throws NonParsableException
The standard constructor for the interface Storable. Creates a new ContinuousAlphabet out of its XML representation.

Parameters:
xml - the XML representation as StringBuffer
Throws:
NonParsableException - if the ContinuousAlphabet could not be reconstructed out of the XML representation (the StringBuffer could not be parsed)
See Also:
Storable
Method Detail

getCurrentParameterSet

public ContinuousAlphabet.ContinuousAlphabetParameterSet 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
Specified by:
getCurrentParameterSet in class Alphabet
Returns:
the current InstanceParameterSet
Throws:
Exception - if the InstanceParameterSet could not be returned

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML representation as StringBuffer 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 of theAlphabet.

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

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)
Indicates 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, false otherwise

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