de.jstacs.parameters
Class SimpleParameterSet

java.lang.Object
  extended by de.jstacs.parameters.ParameterSet
      extended by de.jstacs.parameters.SimpleParameterSet
All Implemented Interfaces:
GalaxyConvertible, Storable, Cloneable

public class SimpleParameterSet
extends ParameterSet

Class for a ParameterSet that is constructed from an array of Parameters.

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.ParameterSet
errorMessage, parameters, parent
 
Constructor Summary
SimpleParameterSet(Parameter... parameters)
          Creates a new SimpleParameterSet from an array of Parameters.
SimpleParameterSet(StringBuffer representation)
          The standard constructor for the interface Storable.
 
Method Summary
 SimpleParameterSet clone()
          Creates a full clone (deep copy) of this ParameterSet.
 void reset()
          Resets all Parameters in this ParameterSet to their default values or null if not default value was provided.
 void toGalaxy(String namePrefix, String configPrefix, int depth, StringBuffer descBuffer, StringBuffer configBuffer, boolean[] addLine)
          Creates an Galaxy XML-representation of the parameters and appends it to descBuffer and variable configuration and appends it to configBuffer.
 
Methods inherited from class de.jstacs.parameters.ParameterSet
fromGalaxy, fromXML, getAllParameterNames, getComment, getComment, getErrorMessage, getIndex, getName, getName, getNumberOfParameters, getParameterAt, getParameterForName, getParent, hasDefaultOrIsSet, initParameterList, initParameterList, isAtomic, isComparable, parametersLoaded, setParent, toGalaxy, toXML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleParameterSet

public SimpleParameterSet(Parameter... parameters)
Creates a new SimpleParameterSet from an array of Parameters.

Parameters:
parameters - the parameters

SimpleParameterSet

public SimpleParameterSet(StringBuffer representation)
                   throws NonParsableException
The standard constructor for the interface Storable. Constructs a SimpleParameterSet from its XML representation.

Parameters:
representation - the XML representation as StringBuffer
Throws:
NonParsableException - if the StringBuffer representation could not be parsed
Method Detail

clone

public SimpleParameterSet 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 ParameterSet
Returns:
a deep clone/copy of this ParameterSet
Throws:
CloneNotSupportedException

reset

public void reset()
Description copied from class: ParameterSet
Resets all Parameters in this ParameterSet to their default values or null if not default value was provided.

Overrides:
reset in class ParameterSet
See Also:
Parameter.reset()

toGalaxy

public void toGalaxy(String namePrefix,
                     String configPrefix,
                     int depth,
                     StringBuffer descBuffer,
                     StringBuffer configBuffer,
                     boolean[] addLine)
              throws Exception
Creates an Galaxy XML-representation of the parameters and appends it to descBuffer and variable configuration and appends it to configBuffer. The variable configuration is also used to parse user-supplied values returned by Galaxy.

Parameters:
namePrefix - the prefix of the variable name used in Galaxy
configPrefix - the prefix for conditionals
depth - the depth in the parameter hierarchy, used for graphical representation of nesting
descBuffer - the buffer for the parameter description
configBuffer - the buffer for the configuration line
addLine - if true, a line is added before the title of a parameter with the corresponding index
Throws:
Exception - if the conversion fails