|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.parameters.Parameter
de.jstacs.parameters.ParameterSetContainer
public class ParameterSetContainer
Class for a Parameter that contains a ParameterSet as value. This ParameterSet
can be set either using the constructor or using the setValue()-method and can be obtained
by the getValue()-method.
ParameterSetContainers can be used to build tree-structures of Parameter.
| Field Summary | |
|---|---|
protected String |
errorMessage
The message of the last error or null if no error occurred |
| Fields inherited from class de.jstacs.parameters.Parameter |
|---|
neededReference, neededReferenceId, parent |
| Constructor Summary | |
|---|---|
ParameterSetContainer(StringBuffer representation)
Creates a new ParameterSetContainer from its XML-representation. |
|
ParameterSetContainer(String name,
String comment,
ParameterSet content)
Creates an new ParameterSetContainer out of a ParameterSet. |
|
| Method Summary | |
|---|---|
boolean |
checkValue(Object value)
Checks the value for correctness, e.g. for numerical parameters this might be checking if the value is within specified bounds |
ParameterSetContainer |
clone()
|
protected void |
fromXML(StringBuffer representation)
Parses a Parameter from an XML-representation as returned by Parameter.toXML(). |
String |
getComment()
Returns a comment on this parameter that tells something about useful values, domains, usage of this parameter, etc. |
DataType |
getDatatype()
Returns the data type of the parameter |
String |
getErrorMessage()
If a value could not be set successfully this method returns the corresponding error message. |
String |
getName()
Returns the name of the parameter |
int |
getNumberOfValues()
Returns the number of values in the collection. |
Parameter |
getRangedInstance()
Returns an instance of RangeIterator that has the same properties as the current instance, but
accepts a range or list of values. |
ParameterSet |
getValue()
Returns the current value of this Parameter |
boolean |
hasDefaultOrIsSet()
Returns true if the parameter either has a default value or the value was set by the user. |
boolean |
isAtomic()
Returns true if the parameter is of an atomic data type |
boolean |
isRangeable()
Returns true if the parameters can be varied over a range of values. |
boolean |
isRanged()
Returns true if this range iterator is ranging over a set of values. |
boolean |
isRequired()
Returns true if the parameter is required, false otherwise |
boolean |
isSet()
Returns true if the parameter was set by the user. |
boolean |
next()
Switches to the next value in the collection of values in the specified range. |
void |
reset()
Resets the parameter and its contents to the default values or null if not
defaults are given. |
void |
resetToFirst()
Resets the current value in the collection to the first value. |
void |
setDefault(Object defaultValue)
Sets the default value of the parameter to defaultValue |
void |
setValue(Object value)
Sets the value of this parameter to value. |
void |
simplify()
Simplifies the Parameter and its contents to the relevant information. |
StringBuffer |
toXML()
This method returns an XML-representation of an instance of the implementing class. |
String |
valuesToString()
Returns a String-representation of the set of values. |
| Methods inherited from class de.jstacs.parameters.Parameter |
|---|
getId, getNeededReference, getNeededReferenceId, getParent, setNeededReference, setParent |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String errorMessage
null if no error occurred
| Constructor Detail |
|---|
public ParameterSetContainer(String name,
String comment,
ParameterSet content)
ParameterSetContainer out of a ParameterSet.
name - the name of the ParameterSetContainercomment - the comment of the ParameterSetContainercontent - the ParameterSet
public ParameterSetContainer(StringBuffer representation)
throws NonParsableException
ParameterSetContainer from its XML-representation.
representation - the XML-representation
NonParsableException - is thrown if representation could not be parsed| Method Detail |
|---|
public ParameterSetContainer clone()
throws CloneNotSupportedException
clone in class ParameterCloneNotSupportedExceptionpublic String getName()
Parameter
getName in class Parameterpublic DataType getDatatype()
Parameter
getDatatype in class Parameterpublic String getComment()
Parameter
getComment in class Parameterpublic boolean isRequired()
Parametertrue if the parameter is required, false otherwise
isRequired in class Parameterpublic boolean checkValue(Object value)
Parameter
checkValue in class Parametervalue - the value to be checked
public void setValue(Object value)
throws SimpleParameter.IllegalValueException
Parametervalue.
setValue in class Parametervalue - the new value
SimpleParameter.IllegalValueException - if the specified value is not valid for this Parameter an IllegalValueException is thrownpublic ParameterSet getValue()
ParameterParameter
getValue in class Parameterpublic boolean hasDefaultOrIsSet()
Parameter
hasDefaultOrIsSet in class Parameterpublic boolean isSet()
Parameter
isSet in class Parameterpublic boolean isAtomic()
Parameter
isAtomic in class Parameterpublic String getErrorMessage()
Parameter
getErrorMessage in class Parameterpublic void simplify()
ParameterCollectionParameter that are not
selected.
simplify in class Parameterpublic void reset()
Parameternull if not
defaults are given.
reset in class Parameter
public void setDefault(Object defaultValue)
throws Exception
ParameterdefaultValue
setDefault in class ParameterdefaultValue - the default value
Exception - throws an Exceptio if the default value is not an appropriate value
for this parameter.public StringBuffer toXML()
Storable
toXML in interface StorabletoXML in class Parameter
protected void fromXML(StringBuffer representation)
throws NonParsableException
ParameterParameter from an XML-representation as returned by Parameter.toXML().
fromXML in class Parameterrepresentation - the XML-representation
NonParsableException - is thrown if the XML-code could not be parsedpublic boolean isRangeable()
Rangeable
isRangeable in interface Rangeable
public Parameter getRangedInstance()
throws Exception
RangeableRangeIterator that has the same properties as the current instance, but
accepts a range or list of values. These values can be obtained by the methods of RangeIterator.
getRangedInstance in interface RangeableException - is thrown if isRangeable() returns false or the ranged instance could
not be created for some other reason
public boolean next()
throws ParameterException
RangeIterator
next in interface RangeIteratorParameterException - if the next value could not be setpublic void resetToFirst()
RangeIterator
resetToFirst in interface RangeIteratorpublic boolean isRanged()
RangeIterator
isRanged in interface RangeIteratorpublic int getNumberOfValues()
RangeIterator
getNumberOfValues in interface RangeIteratorpublic String valuesToString()
RangeIteratorString-representation of the set of values.
valuesToString in interface RangeIterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||