|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.parameters.ParameterSet
de.jstacs.parameters.ExpandableParameterSet
de.jstacs.parameters.ArrayParameterSet
public class ArrayParameterSet
Class for a ParameterSet that consists of a length-Parameter that defines the length
of the array and an array of ParameterSetContainers of this length. Each ParameterSetContainer
in the array holds a ParameterSet as defined by a template. The template is cloned in order to obtain
the specified number of elements in the array. The class takes care of the consistency of the length-Parameter
an the length of the array.
| 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, ranged |
| Constructor Summary | |
|---|---|
ArrayParameterSet(ParameterSet template,
String nameTemplate,
String commentTemplate)
Creates a new ArrayParameterSet from a Class that can be instantiated using this
ArrayParameterSet and templates for the ParameterSet in each element of the array,
the name and the comment that are displayed for the ParameterSetContainers enclosing the ParameterSets. |
|
ArrayParameterSet(ParameterSet template,
String nameTemplate,
String commentTemplate,
String lengthName,
String lengthComment,
NumberValidator<Integer> allowedLengths)
Creates a new ArrayParameterSet from a Class that can be instantiated using this
ArrayParameterSet and templates for the ParameterSet in each element of the array,
the name and the comment that are displayed for the ParameterSetContainers enclosing the ParameterSets. |
|
ArrayParameterSet(StringBuffer representation)
Creates a new ArrayParameterSet from its XML-representation. |
|
| Method Summary | |
|---|---|
protected void |
fromXML(StringBuffer representation)
Parses the instance fields of a ParameterSet from the XML-representation
as returned by ParameterSet.toXML(). |
int |
getNumberOfParameters()
Returns the number of parameters in set |
Parameter |
getParameterAt(int i)
Returns the parameter at position i |
boolean |
hasDefaultOrIsSet()
Returns true if all parameters in this ParameterSet are
either set by the user or have default values. |
protected void |
loadParameters()
Loads the parameters for this ParameterSet. |
StringBuffer |
toXML()
This method returns an XML-representation of an instance of the implementing class. |
| Methods inherited from class de.jstacs.parameters.ExpandableParameterSet |
|---|
addParameterToSet, clone, parameterRemovable, removeParameterFromSet, replaceContentWith, replaceParametersWithRangedInstance |
| Methods inherited from class de.jstacs.parameters.ParameterSet |
|---|
getErrorMessage, getId, getNumberOfValues, getParent, initParameterList, initParameterList, isAtomic, isRanged, makeRanged, next, parametersLoaded, propagateId, recieveId, reset, resetToFirst, setParent, simplify, valuesToString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayParameterSet(ParameterSet template,
String nameTemplate,
String commentTemplate,
String lengthName,
String lengthComment,
NumberValidator<Integer> allowedLengths)
ArrayParameterSet from a Class that can be instantiated using this
ArrayParameterSet and templates for the ParameterSet in each element of the array,
the name and the comment that are displayed for the ParameterSetContainers enclosing the ParameterSets.
template - the template of the ParameterSetnameTemplate - the name-templatecommentTemplate - the comment-templatelengthName - the name of the length-ParameterlengthComment - the comment of the length-ParameterallowedLengths - a NumberValidator to set a lower and upper bound on the number of elements in the array
public ArrayParameterSet(ParameterSet template,
String nameTemplate,
String commentTemplate)
ArrayParameterSet from a Class that can be instantiated using this
ArrayParameterSet and templates for the ParameterSet in each element of the array,
the name and the comment that are displayed for the ParameterSetContainers enclosing the ParameterSets.
template - the template of the ParameterSetnameTemplate - the name-templatecommentTemplate - the comment-template
public ArrayParameterSet(StringBuffer representation)
throws NonParsableException
ArrayParameterSet from its XML-representation.
representation - the XML-representation
NonParsableException - is thrown if representation could not be parsed.| Method Detail |
|---|
protected final void loadParameters()
throws Exception
ParameterSetParameterSet. This is in
most cases done by calling ParameterSet.initParameterList() or ParameterSet.initParameterList(int)
to initialize ParameterSet.parameters and afterwards filling ParameterSet.parameters with instances of subclasses of Parameter.
loadParameters in class ExpandableParameterSetException - an Exception is thrown if the parameters could not be loadedParameterSet.parameters,
Parameterpublic int getNumberOfParameters()
ParameterSet
getNumberOfParameters in class ParameterSetpublic Parameter getParameterAt(int i)
ParameterSeti
getParameterAt in class ParameterSeti - the position
public boolean hasDefaultOrIsSet()
ParameterSetParameterSet 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.hasDefaultOrIsSet() should be called prior to
checking specific constraints.
hasDefaultOrIsSet in class ParameterSet
protected void fromXML(StringBuffer representation)
throws NonParsableException
ParameterSetParameterSet from the XML-representation
as returned by ParameterSet.toXML().
fromXML in class ExpandableParameterSetrepresentation - the XML-representation
NonParsableException - is thrown if the XML-code could not be parsedpublic StringBuffer toXML()
Storable
toXML in interface StorabletoXML in class ExpandableParameterSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||