de.jstacs.data
Class AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet

java.lang.Object
  extended by de.jstacs.parameters.ParameterSet
      extended by de.jstacs.parameters.ExpandableParameterSet
          extended by de.jstacs.data.AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet
All Implemented Interfaces:
GalaxyConvertible, Storable, Cloneable
Enclosing class:
AlphabetContainerParameterSet

public static class AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet
extends ExpandableParameterSet

Class for the parameter set of an array of Alphabets where each Alphabet may be used for one or more sections of positions.

Author:
Jan Grau

Nested Class Summary
 
Nested classes/interfaces inherited from class de.jstacs.parameters.ParameterSet
ParameterSet.ParameterList
 
Field Summary
 
Fields inherited from class de.jstacs.parameters.ExpandableParameterSet
commentTemplate, nameTemplate, template
 
Fields inherited from class de.jstacs.parameters.ParameterSet
errorMessage, parameters, parent
 
Constructor Summary
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet()
          Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet for a set of discrete and continuous Alphabets.
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(Alphabet[] alphabets, int[] indexes)
          Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet from an array of Alphabets and an array of indexes that define the index of the Alphabet in alphabets belonging to that position in indexes.
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(AlphabetContainer.AlphabetContainerType type)
          Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet for a set of discrete or continuous Alphabets.
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(StringBuffer representation)
          The standard constructor for the interface Storable .
 
Method Summary
 AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet clone()
          Creates a full clone (deep copy) of this ParameterSet.
 void fromXML(StringBuffer representation)
          Parses the instance fields of a ParameterSet from the XML representation as returned by ParameterSet.toXML().
 String getInstanceComment()
          Returns a descriptive comment on this AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet.
 String getInstanceName()
          Returns a descriptive name for this AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet.
 boolean hasDefaultOrIsSet()
          Returns true if all parameters in this ParameterSet are either set by the user or have default values.
static LinkedList<Integer> parseSections(String sections)
          Parses the sections as defined in sections to a LinkedList of Integers.
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer of an instance of the implementing class.
 
Methods inherited from class de.jstacs.parameters.ExpandableParameterSet
addParameterToSet, fromGalaxy, parameterRemovable, removeParameterFromSet, replaceContentWith, toGalaxy
 
Methods inherited from class de.jstacs.parameters.ParameterSet
getAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getNumberOfParameters, getParameterAt, getParameterForName, getParent, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, reset, setParent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet

public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(AlphabetContainer.AlphabetContainerType type)
                                                                 throws Exception
Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet for a set of discrete or continuous Alphabets.

Parameters:
type - the type of the Alphabet(s)
Throws:
Exception - if the AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet could not be created
See Also:
ExpandableParameterSet.ExpandableParameterSet(ParameterSet, String, String)

AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet

public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet()
                                                                 throws Exception
Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet for a set of discrete and continuous Alphabets.

Throws:
Exception - if the AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet could not be created

AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet

public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(Alphabet[] alphabets,
                                                                        int[] indexes)
                                                                 throws Exception
Creates a new AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet from an array of Alphabets and an array of indexes that define the index of the Alphabet in alphabets belonging to that position in indexes.

Parameters:
alphabets - the array of Alphabets
indexes - the array of indexes of the Alphabets belonging to the positions
Throws:
Exception - if the AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet could not be created
See Also:
AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet(AlphabetContainer.AlphabetContainerType)

AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet

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

Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the Alphabet.AlphabetParameterSet could not be reconstructed out of the XML representation (the StringBuffer representation could not be parsed)
See Also:
ExpandableParameterSet.ExpandableParameterSet(StringBuffer), Storable
Method Detail

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 ExpandableParameterSet
Returns:
the XML representation

fromXML

public 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 ExpandableParameterSet
Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the XML code could not be parsed
See Also:
ParameterSet.toXML()

hasDefaultOrIsSet

public boolean hasDefaultOrIsSet()
Description copied from class: ParameterSet
Returns true if all parameters in this ParameterSet are either set by the user or have default values. If any additional constraints are required on your parameters you should either specify some ParameterValidator on these parameters or implement these constraints by overriding this method in your implementation of ParameterSet. It is recommended to specify a useful remark which constraint failed in the member-variable errorMessage, which will be displayed to the user. In the overriding method super.ParameterSet.hasDefaultOrIsSet() should be called prior to checking specific constraints.

Overrides:
hasDefaultOrIsSet in class ParameterSet
Returns:
true if all parameters have some allowed value set, false otherwise

parseSections

public static LinkedList<Integer> parseSections(String sections)
                                         throws Exception
Parses the sections as defined in sections to a LinkedList of Integers. Sections may be defined as ranges (e.g. "3-6"), as lists (e.g. "3,4,5,6") or as combinations of both (e.g. "3-5,6").

Parameters:
sections - the sections
Returns:
the LinkedList of positions
Throws:
Exception - if sections could not be parsed, contains a position more than once or contains positions that are out of range

clone

public AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet clone()
                                                                       throws CloneNotSupportedException
Description copied from class: ParameterSet
Creates a full clone (deep copy) of this ParameterSet. As a convenience-method the user can use fillWithStandardFieldsForClone(ParameterSet) on a newly created instance of a subclass of ParameterSet to obtain a clone/copy of all standard member variables (those already defined in ParameterSet) in the passed ParameterSet. Using this method, the cloning process becomes merely three-step:
This method fulfills the conventions of Object's method Object.clone().

Overrides:
clone in class ExpandableParameterSet
Returns:
a deep clone/copy of this ParameterSet
Throws:
CloneNotSupportedException

getInstanceName

public String getInstanceName()
Returns a descriptive name for this AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet.

Returns:
the descriptive name

getInstanceComment

public String getInstanceComment()
Returns a descriptive comment on this AlphabetContainerParameterSet.SectionDefinedAlphabetParameterSet.

Returns:
the descriptive comment