de.jstacs.data
Class AlphabetContainerParameterSet

java.lang.Object
  extended by de.jstacs.parameters.ParameterSet
      extended by de.jstacs.parameters.InstanceParameterSet<T>
          extended by de.jstacs.data.AlphabetContainer.AbstractAlphabetContainerParameterSet<AlphabetContainer>
              extended by de.jstacs.data.AlphabetContainerParameterSet
All Implemented Interfaces:
GalaxyConvertible, Storable, Cloneable

public class AlphabetContainerParameterSet
extends AlphabetContainer.AbstractAlphabetContainerParameterSet<AlphabetContainer>

Class for the AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet of an AlphabetContainer.

Author:
Jan Grau

Nested Class Summary
static class AlphabetContainerParameterSet.AlphabetArrayParameterSet
          Class for the parameters of an array of Alphabets of defined length.
static class AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet
          Class for the parameter set of an array of Alphabets where each Alphabet may be used for one or more sections of positions.
 
Nested classes/interfaces inherited from class de.jstacs.parameters.ParameterSet
ParameterSet.ParameterList
 
Field Summary
 
Fields inherited from class de.jstacs.parameters.ParameterSet
errorMessage, parameters, parent
 
Constructor Summary
  AlphabetContainerParameterSet()
          Creates a new AlphabetContainerParameterSet of a complex AlphabetContainer with type AlphabetContainer.AlphabetContainerType.BOTH.
  AlphabetContainerParameterSet(Alphabet alph)
          Creates a new AlphabetContainerParameterSet of a simple AlphabetContainer from a single Alphabet.
  AlphabetContainerParameterSet(Alphabet[] alphabets)
          Creates a new AlphabetContainerParameterSet from an array of Alphabets.
  AlphabetContainerParameterSet(Alphabet[] alphabets, int[] indexes)
          Creates a new AlphabetContainerParameterSet from an array of Alphabets and an array of ints defining the Alphabet index i in alphabets that is used for position i.
  AlphabetContainerParameterSet(AlphabetContainer.AlphabetContainerType type, boolean simple)
          Creates a new AlphabetContainerParameterSet of an AlphabetContainer with AlphabetContainer.AlphabetContainerType type.
protected AlphabetContainerParameterSet(Class<? extends AlphabetContainer> instanceClass, Alphabet... alphabets)
          /** Creates a new AlphabetContainerParameterSet from an array of Alphabets for a given sub-class of AlphabetContainer.
  AlphabetContainerParameterSet(StringBuffer representation)
          The standard constructor for the interface Storable.
 
Method Summary
protected  void fromXML(StringBuffer representation)
          Parses the instance fields of a ParameterSet from the XML representation as returned by ParameterSet.toXML().
 String getInstanceComment()
          Returns a comment (a textual description) of the class that can be constructed using this ParameterSet.
 String getInstanceName()
          Returns the name of an instance of the class that can be constructed using this ParameterSet.
 int getPossibleLength()
          Returns the length of the AlphabetContainer that can be instantiated using this ParameterSet.
 boolean isDiscrete()
          Indicates if all positions use DiscreteAlphabet.DiscreteAlphabetParameterSet, i.e.
 boolean isSimple()
          Indicates if all positions use the same Alphabet, i.e.
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer of an instance of the implementing class.
 
Methods inherited from class de.jstacs.data.AlphabetContainer.AbstractAlphabetContainerParameterSet
clone
 
Methods inherited from class de.jstacs.parameters.InstanceParameterSet
getInstance, getInstanceClass
 
Methods inherited from class de.jstacs.parameters.ParameterSet
fromGalaxy, getAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getNumberOfParameters, getParameterAt, getParameterForName, getParent, hasDefaultOrIsSet, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, reset, setParent, toGalaxy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphabetContainerParameterSet

public AlphabetContainerParameterSet(AlphabetContainer.AlphabetContainerType type,
                                     boolean simple)
                              throws Exception
Creates a new AlphabetContainerParameterSet of an AlphabetContainer with AlphabetContainer.AlphabetContainerType type. If simple is true, only a single Alphabet is expected.

Parameters:
type - the type of the alphabet(s)
simple - indicates if there shall be only a single Alphabet
Throws:
Exception - if the parameters could not be created for the given arguments
See Also:
AlphabetContainer.AlphabetContainerType, InstanceParameterSet.InstanceParameterSet(Class)

AlphabetContainerParameterSet

public AlphabetContainerParameterSet()
                              throws Exception
Creates a new AlphabetContainerParameterSet of a complex AlphabetContainer with type AlphabetContainer.AlphabetContainerType.BOTH.

Throws:
Exception - if the AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet could not be created
See Also:
AlphabetContainerParameterSet(AlphabetContainer.AlphabetContainerType, boolean)

AlphabetContainerParameterSet

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

Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the AlphabetContainerParameterSet could not be reconstructed out of the XML representation (the StringBuffer representation could not be parsed)
See Also:
InstanceParameterSet.InstanceParameterSet(StringBuffer), Storable

AlphabetContainerParameterSet

public AlphabetContainerParameterSet(Alphabet alph)
                              throws Exception
Creates a new AlphabetContainerParameterSet of a simple AlphabetContainer from a single Alphabet.

Parameters:
alph - the Alphabet
Throws:
Exception - if an error occurred during the creation of the appropriate parameters
See Also:
InstanceParameterSet.InstanceParameterSet(Class)

AlphabetContainerParameterSet

public AlphabetContainerParameterSet(Alphabet[] alphabets)
                              throws Exception
Creates a new AlphabetContainerParameterSet from an array of Alphabets.

Parameters:
alphabets - the array of Alphabets
Throws:
Exception - if an error occurred during the creation of the appropriate parameters
See Also:
InstanceParameterSet.InstanceParameterSet(Class)

AlphabetContainerParameterSet

protected AlphabetContainerParameterSet(Class<? extends AlphabetContainer> instanceClass,
                                        Alphabet... alphabets)
                                 throws Exception
/** Creates a new AlphabetContainerParameterSet from an array of Alphabets for a given sub-class of AlphabetContainer.

Parameters:
instanceClass - the sub-class fo AlphabetContainer
alphabets - the alphabets
Throws:
Exception - if the parameters could not be created for the given arguments

AlphabetContainerParameterSet

public AlphabetContainerParameterSet(Alphabet[] alphabets,
                                     int[] indexes)
                              throws Exception
Creates a new AlphabetContainerParameterSet from an array of Alphabets and an array of ints defining the Alphabet index i in alphabets that is used for position i.

Parameters:
alphabets - the Alphabets
indexes - the indexes
Throws:
Exception - if an error occurred during the creation of the appropriate parameters
See Also:
InstanceParameterSet.InstanceParameterSet(Class)
Method Detail

isDiscrete

public boolean isDiscrete()
Indicates if all positions use DiscreteAlphabet.DiscreteAlphabetParameterSet, i.e. if all Alphabets of the corresponding AlphabetContainer are discrete.

Specified by:
isDiscrete in class AlphabetContainer.AbstractAlphabetContainerParameterSet<AlphabetContainer>
Returns:
true if all positions are discrete, false otherwise
See Also:
AlphabetContainer.isDiscrete()

isSimple

public boolean isSimple()
Description copied from class: AlphabetContainer.AbstractAlphabetContainerParameterSet
Indicates if all positions use the same Alphabet, i.e. if the corresponding AlphabetContainer is simple.

Specified by:
isSimple in class AlphabetContainer.AbstractAlphabetContainerParameterSet<AlphabetContainer>
Returns:
true if all positions use the same Alphabet, false otherwise

toXML

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

Specified by:
toXML in interface Storable
Overrides:
toXML in class InstanceParameterSet<AlphabetContainer>
Returns:
the XML representation

fromXML

protected void fromXML(StringBuffer representation)
                throws NonParsableException
Description copied from class: ParameterSet
Parses the instance fields of a ParameterSet from the XML representation as returned by ParameterSet.toXML().

Overrides:
fromXML in class InstanceParameterSet<AlphabetContainer>
Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the XML code could not be parsed
See Also:
ParameterSet.toXML()

getPossibleLength

public int getPossibleLength()
Description copied from class: AlphabetContainer.AbstractAlphabetContainerParameterSet
Returns the length of the AlphabetContainer that can be instantiated using this ParameterSet.

Specified by:
getPossibleLength in class AlphabetContainer.AbstractAlphabetContainerParameterSet<AlphabetContainer>
Returns:
the length
See Also:
AlphabetContainer.getPossibleLength()

getInstanceName

public String getInstanceName()
Description copied from class: InstanceParameterSet
Returns the name of an instance of the class that can be constructed using this ParameterSet.

Specified by:
getInstanceName in class InstanceParameterSet<AlphabetContainer>
Returns:
the name of the class

getInstanceComment

public String getInstanceComment()
Description copied from class: InstanceParameterSet
Returns a comment (a textual description) of the class that can be constructed using this ParameterSet.

Specified by:
getInstanceComment in class InstanceParameterSet<AlphabetContainer>
Returns:
the comment of the class