public class EnumParameter extends SelectionParameter
SelectionParameter based on an Enum.
Internally it is based on Strings, i.e. the names of the Enum
constants. The methods setDefault(Object) and
setValue(Object) can be used with Strings or with the
Enum constants.AbstractSelectionParameter.InconsistentCollectionExceptionerrorMessage, parameters, userSelectedcomment, datatype, name| Constructor and Description |
|---|
EnumParameter(Class<? extends Enum> enumInstance,
String comment,
boolean required)
The main constructor.
|
EnumParameter(Class<? extends Enum> enumInstance,
String comment,
boolean required,
String defaultValue)
This constructor creates an instance and set the default value.
|
EnumParameter(StringBuffer representation)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendFurtherInfos(StringBuffer buf)
This method can be used in the method
Storable.toXML() to extract
further information (name, comment, datatype). |
protected void |
extractFurtherInfos(StringBuffer buf)
This method can be used in the constructor with parameter
StringBuffer to
extract the further information. |
Enum |
getValue()
Returns the value of the
AnnotatedEntity. |
void |
setDefault(Object defaultValue)
Sets the default value of this
AbstractSelectionParameter to
defaultValue. |
void |
setValue(Object value)
Sets the selected value to the one that is specified by the key
value. |
fromGalaxy, getDefault, getErrorMessage, getSelected, getXMLTag, hasDefault, hasDefaultOrIsSet, isSelected, reset, toStringcheck, checkValue, clone, createParameterSet, equals, getParametersInCollection, getRangedInstance, isAtomic, isComparable, isRangeable, isRequired, isSet, isUserSelected, setRangeable, toGalaxygetComment, getDatatype, getName, toXMLfinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetRangedInstance, isRangeabletoGalaxypublic EnumParameter(Class<? extends Enum> enumInstance, String comment, boolean required) throws ParameterException
enumInstance - the Enum class, e.g.
DataSet.PartitionMethod.classcomment - a comment on this parameterrequired - true if this EnumParameter is required,
false otherwiseParameterException - is never thrown but exists due to the class hierarchypublic EnumParameter(Class<? extends Enum> enumInstance, String comment, boolean required, String defaultValue) throws ParameterException
enumInstance - the Enum class, e.g.
DataSet.PartitionMethod.classcomment - a comment on this parameterrequired - true if this EnumParameter is required,
false otherwisedefaultValue - the default value of this parameterParameterException - is never thrown but exists due to the class hierarchyEnumParameter(Class, String, boolean),
setDefault(Object)public EnumParameter(StringBuffer representation) throws NonParsableException
Storable.
Restores an instance of EnumParameter from a XML representation.representation - the XML representation as StringBufferNonParsableException - if the StringBuffer representation could
not be parsedprotected void appendFurtherInfos(StringBuffer buf)
AnnotatedEntityStorable.toXML() to extract
further information (name, comment, datatype).appendFurtherInfos in class SelectionParameterbuf - a XML representation of the main information as
StringBufferStorable.toXML()protected void extractFurtherInfos(StringBuffer buf) throws NonParsableException
AnnotatedEntityStringBuffer to
extract the further information.extractFurtherInfos in class SelectionParameterbuf - a XML represenation of the main information as
StringBufferNonParsableException - if the XML representation is not parsableAnnotatedEntity.AnnotatedEntity(StringBuffer)public Enum getValue()
AnnotatedEntityAnnotatedEntity.getValue in class SelectionParameterAnnotatedEntitypublic void setValue(Object value) throws SimpleParameter.IllegalValueException
SelectionParametervalue.setValue in class SelectionParametervalue - the key of the desired valueSimpleParameter.IllegalValueException - if the specified value is not valid for this
Parameterpublic void setDefault(Object defaultValue) throws SimpleParameter.IllegalValueException
AbstractSelectionParameterAbstractSelectionParameter to
defaultValue. This method also sets the current
value of this AbstractSelectionParameter to the default
and resets it such that AbstractSelectionParameter.isUserSelected()
returns false.setDefault in class SelectionParameterdefaultValue - the default valueSimpleParameter.IllegalValueException