org.opensha.commons.param.impl
Class TranslatedWarningDoubleParameter

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<java.lang.Double>
      extended by org.opensha.commons.param.impl.DoubleParameter
          extended by org.opensha.commons.param.impl.WarningDoubleParameter
              extended by org.opensha.commons.param.impl.TranslatedWarningDoubleParameter
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<java.lang.Double>, WarningParameter<java.lang.Double>

public class TranslatedWarningDoubleParameter
extends WarningDoubleParameter

Title: TranslatedWarningDoubleParameter

Description: A subclass of a warning double parameter so it inherits all behavior of the parent class. See the parent class javadocs for a full description of it's behavior. Only the added features of this subclass will be outlined here.

The whole purpose of a TranslatedWarningDoubleParameter is to be a "wrapper" for a WarningDoubleParameter and translate all setting, getting values to the warning parameter. This Translated parameter becomes a proxy to the "wrapped" WarningParameter. In object-oriented design patterns this is called the "Decorator Pattern". Instead of subclassing you "wrap" (maintain a variable reference ) to the clss of interest. This class then slightly modifies the behavior of the "wrapped" class transparently. This helps eliminate proliferation of subclasses.

The TranslatedWarningDoubleParameter makes use of a second class, a TranslatorAPI that actually performs the translation back and fourth internally. An API was defined so that any type of implementation translation class could be passed in. This translation class is simply some function. The class acts as a pointer to a function, so you can swap out different functions without changing this class. Currently the only concrete translator class implemented is the LogTranslator.

The logical purpose of this class is to input values in one form, then translate them to the desired form, and use the translated values in a calculation. So with this in mind it is really the input values that are translated, and the translator puts them back in the correct form.

An example is that in our IMRTesterApplet we let users edit the IMR level in normal space using this Parameter class. The values are internally translated to log space in the contained WarningDoubleParameter. So the user only sees normal values for the current IMR level, and it's constraints, but internally the values are really in log space. The IMR needs the parameter in log space to perform it's calculations. It is much easier for a user to input normal values say 1-200, than the log of this range.

If the translate flag is set to false, this class then acts as a transparent proxy to the underlying WarningDoubleParameter. No translations are made.

Version:
1.0
Author:
Steven W. Rock
See Also:
WarningDoubleParameter, TranslatorAPI, LogTranslator, Serialized Form

Field Summary
protected static java.lang.String C
          Class name for debugging.
protected static boolean D
          If true print out debug statements.
protected  WarningDoubleParameter param
          Internal reference to the wrapped parameter
protected  TranslatorAPI trans
          Default translator is LogTranslator.
protected  boolean translate
          If true, translation will occur on get, and setValue operations.
 
Fields inherited from class org.opensha.commons.param.impl.WarningDoubleParameter
warningConstraint, warningListeners
 
Fields inherited from class org.opensha.commons.param.AbstractParameter
constraint, defaultValue, editable, independentParameters, info, metadataString, name, units, value, XML_COMPLEX_VAL_EL_NAME, XML_GROUP_METADATA_NAME, XML_METADATA_NAME, XML_NULL_VALUE
 
Fields inherited from interface org.opensha.commons.param.Parameter
XML_INDEPENDENT_PARAMS_NAME
 
Fields inherited from interface org.opensha.commons.metadata.XMLSaveable
XML_METADATA_NAME
 
Constructor Summary
TranslatedWarningDoubleParameter(WarningDoubleParameter param)
          Allows setting the parameter upon construction.
TranslatedWarningDoubleParameter(WarningDoubleParameter param, TranslatorAPI trans)
          Allows setting the parameter for translation access, and setting the translator function upon construction.
 
Method Summary
 void addIndependentParameter(Parameter parameter)
          Direct proxy to wrapped parameter.
 void addParameterChangeFailListener(ParameterChangeFailListener listener)
          Adds a feature to the ParameterChangeFailListener attribute of the ParameterEditor object
 void addParameterChangeListener(ParameterChangeListener listener)
          Adds a feature to the ParameterChangeListener attribute of the ParameterEditor object
 void addParameterChangeWarningListener(ParameterChangeWarningListener listener)
          Direct proxy to wrapped parameter.
 java.lang.Object clone()
          Returns a copy so you can't edit or damage the origial.
 boolean containsIndependentParameter(java.lang.String name)
          Direct proxy to wrapped parameter.
 void fireParameterChangeWarning(ParameterChangeWarningEvent event)
          Description of the Method
 void firePropertyChange(ParameterChangeEvent event)
          Description of the Method
 void firePropertyChangeFailed(ParameterChangeFailEvent event)
          Description of the Method
 ParameterConstraint getConstraint()
          Gets the constraints of this parameter.
 java.lang.String getConstraintName()
          Direct proxy to wrapped parameter.
 java.lang.Double getDefaultValue()
          Returns the parameter's default value.
 java.lang.String getDependentParamMetadataString()
          Rather than giving the name and value info, this returns the name and the name/value pairs for all the parameters in the IndependentParameterList of this parameter.
 ParameterEditor<java.lang.Double> getEditor()
          Returns the Editor for this Parameter.
 Parameter getIndependentParameter(java.lang.String name)
          Direct proxy to wrapped parameter.
 ParameterList getIndependentParameterList()
          Direct proxy to wrapped parameter.
 java.lang.String getIndependentParametersKey()
          Direct proxy to wrapped parameter.
 java.lang.String getInfo()
          Direct proxy to wrapped parameter.
 java.lang.Double getMax()
          Returns the maximum allowed value of the constraint object.
 java.lang.String getMetadataString()
           
 java.lang.Double getMin()
          Gets the min value of the constraint object.
 java.lang.String getName()
          Direct proxy to wrapped parameter.
 int getNumIndependentParameters()
          Direct proxy to wrapped parameter.
 WarningDoubleParameter getParameter()
          Public access to the wrapped parameter, allows getting the parameter.
 TranslatorAPI getTrans()
           
 java.lang.String getType()
          Returns the data type of the value object.
 java.lang.String getUnits()
          Direct proxy to wrapped parameter.
 java.lang.Double getValue()
          Returns the parameter's value.
 AbstractParameterConstraint getWarningConstraint()
          Direct proxy to wrapped parameter.
 java.lang.Double getWarningMax()
          Gets the max value of the constraint object.
 java.lang.Double getWarningMin()
          Gets the min value of the constraint object.
 boolean isAllowed(java.lang.Double value)
          Translated proxy values to constraint check when setting a value.
 boolean isEditable()
          Determines if the value can be edited, i.e.
 boolean isIgnoreWarning()
          Direct proxy to wrapped parameter.
 boolean isNullAllowed()
          Proxy function call to the constraint to see if null values are permitted
 boolean isRecommended(java.lang.Double obj)
          Uses the constraint object to determine if the new value being set is within recommended range.
 boolean isTranslate()
          Returns true if translation is in affect, false otherwise
 void removeIndependentParameter(java.lang.String name)
          Direct proxy to wrapped parameter.
 void removeParameterChangeFailListener(ParameterChangeFailListener listener)
          Description of the Method
 void removeParameterChangeListener(ParameterChangeListener listener)
          Description of the Method
 void removeParameterChangeWarningListener(ParameterChangeWarningListener listener)
          Direct proxy to wrapped parameter.
 void setConstraint(ParameterConstraint constraint)
          Direct proxy to wrapped parameter.
 void setDefaultValue(java.lang.Double defaultValue)
          Set's the default value.
 void setIgnoreWarning(boolean ignoreWarning)
          Direct proxy to wrapped parameter.
 void setIndependentParameters(ParameterList list)
          Direct proxy to wrapped parameter.
 void setInfo(java.lang.String info)
          Direct proxy to wrapped parameter.
 void setName(java.lang.String name)
          Direct proxy to wrapped parameter.
 void setNonEditable()
          Disables editing the value once it is set.
 void setParameter(WarningDoubleParameter param)
          Public access to the wrapped parameter, allows setting the parameter.
 void setTranslate(boolean translate)
          Public api that allows enabling or disabling translation.
 void setUnits(java.lang.String units)
          Direct proxy to wrapped parameter.
 void setValue(java.lang.Double value)
          Set's the parameter's value in the underlying parameter.
 void setValueAsDefault()
          This sets the value as the default setting
 void setValueIgnoreWarning(java.lang.Double value)
          Set's the parameter's value in the underlying parameter.
 void setWarningConstraint(AbstractParameterConstraint warningConstraint)
          Direct proxy to wrapped parameter.
 Element toXMLMetadata(Element root)
           
 Element toXMLMetadata(Element root, java.lang.String elementName)
          Saves this parameter into the supplied XML metadata Element using the specified name instead of the default.
 void unableToSetValue(java.lang.Object value)
          Needs to be called by subclasses when field change fails due to constraint problems
 
Methods inherited from class org.opensha.commons.param.impl.WarningDoubleParameter
setIndividualParamValueFromXML
 
Methods inherited from class org.opensha.commons.param.impl.DoubleParameter
setValue
 
Methods inherited from class org.opensha.commons.param.AbstractParameter
checkEditable, compareTo, equals, setDependentParamMetadataString, setIndepParamsFromXML, setValueFromXMLMetadata, valueToXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.param.WarningParameter
equals
 
Methods inherited from interface org.opensha.commons.param.Parameter
setValueFromXMLMetadata
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

C

protected static final java.lang.String C
Class name for debugging.

See Also:
Constant Field Values

D

protected static final boolean D
If true print out debug statements.

See Also:
Constant Field Values

trans

protected TranslatorAPI trans
Default translator is LogTranslator. The translator class is basically a pointer to a function with translate and reverse operations.


translate

protected boolean translate
If true, translation will occur on get, and setValue operations. If false this class acts as a passthrough to the underlying WarningDoubleParameter, in other words this subclass becomes transparent and has no affect.


param

protected WarningDoubleParameter param
Internal reference to the wrapped parameter

Constructor Detail

TranslatedWarningDoubleParameter

public TranslatedWarningDoubleParameter(WarningDoubleParameter param)
Allows setting the parameter upon construction. The translator defaults to the LogTranslator. This form allows passing in normal values that get translated to log values and set in the underlying parameter.

Note: No translation changes are applied to the passed in parameter. It is assumed that the parameter is already in translated log space.


TranslatedWarningDoubleParameter

public TranslatedWarningDoubleParameter(WarningDoubleParameter param,
                                        TranslatorAPI trans)
Allows setting the parameter for translation access, and setting the translator function upon construction.

Note: No translation changes are applied to the passed in parameter. It is assumed that the parameter is already in translated space.

Method Detail

isTranslate

public boolean isTranslate()
Returns true if translation is in affect, false otherwise


setTranslate

public void setTranslate(boolean translate)
Public api that allows enabling or disabling translation. If disabled, this class acts as if it was transparent, i.e. it does noting, just provides passthrough to the underlying WarningDoubleParameter functions.


setParameter

public void setParameter(WarningDoubleParameter param)
Public access to the wrapped parameter, allows setting the parameter.

Note: No translation changes are applied to the passed in parameter. It is assumed that the parameter is already in translated space.


getParameter

public WarningDoubleParameter getParameter()
Public access to the wrapped parameter, allows getting the parameter. This is useful for normal access to the parameter in translated space.

Note: No translation changes are applied to the fetched parameter. It is assumed that the parameter is returned in translated space.


getWarningMin

public java.lang.Double getWarningMin()
                               throws java.lang.Exception
Gets the min value of the constraint object. Does a reverse translation on the underlying Parameter data if the translate flag is set.

Specified by:
getWarningMin in interface WarningParameter<java.lang.Double>
Overrides:
getWarningMin in class WarningDoubleParameter
Returns:
The reverse translated min value.
Throws:
java.lang.Exception - Thrown if any mathmatical exceptions occur.

isAllowed

public boolean isAllowed(java.lang.Double value)
Translated proxy values to constraint check when setting a value.

Specified by:
isAllowed in interface Parameter<java.lang.Double>
Overrides:
isAllowed in class DoubleParameter
Parameters:
value - Description of the Parameter
Returns:
The allowed value

getWarningMax

public java.lang.Double getWarningMax()
Gets the max value of the constraint object. Does a reverse translation on the underlying Parameter data if the translate flag is set.

Specified by:
getWarningMax in interface WarningParameter<java.lang.Double>
Overrides:
getWarningMax in class WarningDoubleParameter
Returns:
The reverse translated max value.
Throws:
java.lang.Exception - Thrown if any mathmatical exceptions occur.

setValue

public void setValue(java.lang.Double value)
              throws ConstraintException,
                     WarningException
Set's the parameter's value in the underlying parameter. Translation is performed on the value if the translate flag is set before passing to the WarningDoubleParameter. Note, if this object is not a Double, it is passed through without translation. WarningDoubleParameter constraint will fail.

Specified by:
setValue in interface Parameter<java.lang.Double>
Overrides:
setValue in class WarningDoubleParameter
Parameters:
value - The new value for this Parameter
Throws:
ParameterException - Thrown if the object is currenlty not editable
ConstraintException - Thrown if the object value is not allowed
WarningException - Thrown if the new value is beyond the warning levels.

unableToSetValue

public void unableToSetValue(java.lang.Object value)
                      throws ConstraintException
Needs to be called by subclasses when field change fails due to constraint problems

Specified by:
unableToSetValue in interface Parameter<java.lang.Double>
Overrides:
unableToSetValue in class AbstractParameter<java.lang.Double>
Parameters:
value - Description of the Parameter
Throws:
ConstraintException - Description of the Exception

getValue

public java.lang.Double getValue()
Returns the parameter's value. Each subclass defines what type of object. it returns

Specified by:
getValue in interface Parameter<java.lang.Double>
Overrides:
getValue in class AbstractParameter<java.lang.Double>
Returns:
The value value

setDefaultValue

public void setDefaultValue(java.lang.Double defaultValue)
                     throws ConstraintException
Set's the default value.

Specified by:
setDefaultValue in interface Parameter<java.lang.Double>
Overrides:
setDefaultValue in class AbstractParameter<java.lang.Double>
Parameters:
defaultValue - The default value for this Parameter.
Throws:
ConstraintException - Thrown if the object value is not allowed.

setValueAsDefault

public void setValueAsDefault()
                       throws ConstraintException,
                              ParameterException
This sets the value as the default setting

Specified by:
setValueAsDefault in interface Parameter<java.lang.Double>
Overrides:
setValueAsDefault in class AbstractParameter<java.lang.Double>
Parameters:
value -
Throws:
ConstraintException
ParameterException

getDefaultValue

public java.lang.Double getDefaultValue()
Returns the parameter's default value. Each subclass defines what type of object it returns.

Specified by:
getDefaultValue in interface Parameter<java.lang.Double>
Overrides:
getDefaultValue in class AbstractParameter<java.lang.Double>
Returns:
the default value

setValueIgnoreWarning

public void setValueIgnoreWarning(java.lang.Double value)
                           throws ConstraintException,
                                  ParameterException
Set's the parameter's value in the underlying parameter. Translation is performed on the value if the translate flag is set before passing to the WarningDoubleParameter. The warning constraints are ignored.

Note, if this object is not a Double, it is passed through without translation. WarningDoubleParameter constraint will fail.

Specified by:
setValueIgnoreWarning in interface WarningParameter<java.lang.Double>
Overrides:
setValueIgnoreWarning in class WarningDoubleParameter
Parameters:
value - The new value for this Parameter
Throws:
ParameterException - Thrown if the object is currenlty not editable
ConstraintException - Thrown if the object value is not allowed

isRecommended

public boolean isRecommended(java.lang.Double obj)
Uses the constraint object to determine if the new value being set is within recommended range. If no Constraints are present all values are recommended. Translation is performed on the value if the translate flag is set before passing to the WarningDoubleParameter function.

Specified by:
isRecommended in interface WarningParameter<java.lang.Double>
Overrides:
isRecommended in class WarningDoubleParameter
Parameters:
obj - Object to check if allowed via constraints
Returns:
True if the value is allowed

getMin

public java.lang.Double getMin()
                        throws java.lang.Exception
Gets the min value of the constraint object. Does a reverse translation on the underlying Parameter data if the translate flag is set.

Overrides:
getMin in class DoubleParameter
Returns:
The min value
Throws:
java.lang.Exception - Description of the Exception

getMax

public java.lang.Double getMax()
Returns the maximum allowed value of the constraint object. Does a reverse translation on the underlying Parameter data if the translate flag is set.

Overrides:
getMax in class DoubleParameter
Returns:
The max value

setIgnoreWarning

public void setIgnoreWarning(boolean ignoreWarning)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setIgnoreWarning in interface WarningParameter<java.lang.Double>
Overrides:
setIgnoreWarning in class WarningDoubleParameter

isIgnoreWarning

public boolean isIgnoreWarning()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
isIgnoreWarning in interface WarningParameter<java.lang.Double>
Overrides:
isIgnoreWarning in class WarningDoubleParameter

setWarningConstraint

public void setWarningConstraint(AbstractParameterConstraint warningConstraint)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setWarningConstraint in interface WarningParameter<java.lang.Double>
Overrides:
setWarningConstraint in class WarningDoubleParameter

getWarningConstraint

public AbstractParameterConstraint getWarningConstraint()
                                                 throws ParameterException
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getWarningConstraint in interface WarningParameter<java.lang.Double>
Overrides:
getWarningConstraint in class WarningDoubleParameter
Throws:
ParameterException

addParameterChangeWarningListener

public void addParameterChangeWarningListener(ParameterChangeWarningListener listener)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
addParameterChangeWarningListener in interface WarningParameter<java.lang.Double>
Overrides:
addParameterChangeWarningListener in class WarningDoubleParameter
Parameters:
listener - The feature to be added to the ParameterChangeFailListener attribute

removeParameterChangeWarningListener

public void removeParameterChangeWarningListener(ParameterChangeWarningListener listener)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
removeParameterChangeWarningListener in interface WarningParameter<java.lang.Double>
Overrides:
removeParameterChangeWarningListener in class WarningDoubleParameter

addParameterChangeFailListener

public void addParameterChangeFailListener(ParameterChangeFailListener listener)
Adds a feature to the ParameterChangeFailListener attribute of the ParameterEditor object

Specified by:
addParameterChangeFailListener in interface Parameter<java.lang.Double>
Overrides:
addParameterChangeFailListener in class AbstractParameter<java.lang.Double>
Parameters:
listener - The feature to be added to the ParameterChangeFailListener attribute

removeParameterChangeFailListener

public void removeParameterChangeFailListener(ParameterChangeFailListener listener)
Description of the Method

Specified by:
removeParameterChangeFailListener in interface Parameter<java.lang.Double>
Overrides:
removeParameterChangeFailListener in class AbstractParameter<java.lang.Double>
Parameters:
listener - Description of the Parameter

addParameterChangeListener

public void addParameterChangeListener(ParameterChangeListener listener)
Adds a feature to the ParameterChangeListener attribute of the ParameterEditor object

Specified by:
addParameterChangeListener in interface Parameter<java.lang.Double>
Overrides:
addParameterChangeListener in class AbstractParameter<java.lang.Double>
Parameters:
listener - The feature to be added to the ParameterChangeListener attribute

removeParameterChangeListener

public void removeParameterChangeListener(ParameterChangeListener listener)
Description of the Method

Specified by:
removeParameterChangeListener in interface Parameter<java.lang.Double>
Overrides:
removeParameterChangeListener in class AbstractParameter<java.lang.Double>
Parameters:
listener - Description of the Parameter

firePropertyChange

public void firePropertyChange(ParameterChangeEvent event)
Description of the Method

Specified by:
firePropertyChange in interface Parameter<java.lang.Double>
Overrides:
firePropertyChange in class AbstractParameter<java.lang.Double>
Parameters:
event - Description of the Parameter

firePropertyChangeFailed

public void firePropertyChangeFailed(ParameterChangeFailEvent event)
Description of the Method

Specified by:
firePropertyChangeFailed in interface Parameter<java.lang.Double>
Overrides:
firePropertyChangeFailed in class AbstractParameter<java.lang.Double>
Parameters:
event - Description of the Parameter

fireParameterChangeWarning

public void fireParameterChangeWarning(ParameterChangeWarningEvent event)
Description of the Method

Specified by:
fireParameterChangeWarning in interface WarningParameter<java.lang.Double>
Overrides:
fireParameterChangeWarning in class WarningDoubleParameter
Parameters:
event - Description of the Parameter

clone

public java.lang.Object clone()
Returns a copy so you can't edit or damage the origial.

Specified by:
clone in interface Parameter<java.lang.Double>
Overrides:
clone in class WarningDoubleParameter
Returns:
Exact copy of this object's state

getIndependentParameterList

public ParameterList getIndependentParameterList()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getIndependentParameterList in interface Parameter<java.lang.Double>
Overrides:
getIndependentParameterList in class AbstractParameter<java.lang.Double>
Returns:
the independent parameter list for the dependent parameter

getIndependentParameter

public Parameter getIndependentParameter(java.lang.String name)
                                  throws ParameterException
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getIndependentParameter in interface Parameter<java.lang.Double>
Overrides:
getIndependentParameter in class AbstractParameter<java.lang.Double>
Parameters:
name - Parameter name to lookup.
Returns:
The found independent Parameter.
Throws:
ParameterException - Thrown if not one of the independent parameters.

setIndependentParameters

public void setIndependentParameters(ParameterList list)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setIndependentParameters in interface Parameter<java.lang.Double>
Overrides:
setIndependentParameters in class AbstractParameter<java.lang.Double>

addIndependentParameter

public void addIndependentParameter(Parameter parameter)
                             throws ParameterException
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
addIndependentParameter in interface Parameter<java.lang.Double>
Overrides:
addIndependentParameter in class AbstractParameter<java.lang.Double>
Throws:
ParameterException

containsIndependentParameter

public boolean containsIndependentParameter(java.lang.String name)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
containsIndependentParameter in interface Parameter<java.lang.Double>
Overrides:
containsIndependentParameter in class AbstractParameter<java.lang.Double>

removeIndependentParameter

public void removeIndependentParameter(java.lang.String name)
                                throws ParameterException
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
removeIndependentParameter in interface Parameter<java.lang.Double>
Overrides:
removeIndependentParameter in class AbstractParameter<java.lang.Double>
Throws:
ParameterException

getIndependentParametersKey

public java.lang.String getIndependentParametersKey()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getIndependentParametersKey in interface Parameter<java.lang.Double>
Overrides:
getIndependentParametersKey in class AbstractParameter<java.lang.Double>
Returns:
the dependent parameter name and all its independent Params Values.

getNumIndependentParameters

public int getNumIndependentParameters()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getNumIndependentParameters in interface Parameter<java.lang.Double>
Overrides:
getNumIndependentParameters in class AbstractParameter<java.lang.Double>

getName

public java.lang.String getName()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getName in interface Named
Overrides:
getName in class AbstractParameter<java.lang.Double>

setName

public void setName(java.lang.String name)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setName in interface Parameter<java.lang.Double>
Overrides:
setName in class AbstractParameter<java.lang.Double>
Parameters:
name - to set

getConstraintName

public java.lang.String getConstraintName()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getConstraintName in interface Parameter<java.lang.Double>
Overrides:
getConstraintName in class AbstractParameter<java.lang.Double>

getConstraint

public ParameterConstraint getConstraint()
Gets the constraints of this parameter. Each subclass may implement any type of constraint it likes. This version returns a clone with reverse translated min and max values.

Specified by:
getConstraint in interface Parameter<java.lang.Double>
Overrides:
getConstraint in class AbstractParameter<java.lang.Double>
Returns:
The constraint value

setConstraint

public void setConstraint(ParameterConstraint constraint)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setConstraint in interface Parameter<java.lang.Double>
Overrides:
setConstraint in class DoubleParameter
Parameters:
constraint - The new constraint.

getUnits

public java.lang.String getUnits()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getUnits in interface Parameter<java.lang.Double>
Overrides:
getUnits in class AbstractParameter<java.lang.Double>
Returns:
the units

setUnits

public void setUnits(java.lang.String units)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setUnits in interface Parameter<java.lang.Double>
Overrides:
setUnits in class AbstractParameter<java.lang.Double>
Parameters:
units - to set

getInfo

public java.lang.String getInfo()
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
getInfo in interface Parameter<java.lang.Double>
Overrides:
getInfo in class AbstractParameter<java.lang.Double>
Returns:
a brief description of this Parameter

setInfo

public void setInfo(java.lang.String info)
Direct proxy to wrapped parameter. See that class for documentation.

Specified by:
setInfo in interface Parameter<java.lang.Double>
Overrides:
setInfo in class AbstractParameter<java.lang.Double>
Parameters:
info - to set

getType

public java.lang.String getType()
Returns the data type of the value object. Used to determine which type of Editor to use in a GUI.

Specified by:
getType in interface Parameter<java.lang.Double>
Overrides:
getType in class DoubleParameter
Returns:
The type value - i.e. the class name.

isEditable

public boolean isEditable()
Determines if the value can be edited, i.e. changed once set.

Specified by:
isEditable in interface Parameter<java.lang.Double>
Overrides:
isEditable in class AbstractParameter<java.lang.Double>
Returns:
The editable value

setNonEditable

public void setNonEditable()
Disables editing the value once it is set.

Specified by:
setNonEditable in interface Parameter<java.lang.Double>
Overrides:
setNonEditable in class AbstractParameter<java.lang.Double>

getMetadataString

public java.lang.String getMetadataString()
Specified by:
getMetadataString in interface Parameter<java.lang.Double>
Overrides:
getMetadataString in class AbstractParameter<java.lang.Double>
Returns:
the matadata string for parameter. This function returns the metadata which can be used to reset the values of the parameters created. *NOTE : Look at the function getMetadataXML() which return the values of these parameters in the XML format and can used recreate the parameters from scratch.

getDependentParamMetadataString

public java.lang.String getDependentParamMetadataString()
Rather than giving the name and value info, this returns the name and the name/value pairs for all the parameters in the IndependentParameterList of this parameter. This can be used for any parameters where the value does not have a sensible ascii representation (e.g., a ParameterListParameter).

Specified by:
getDependentParamMetadataString in interface Parameter<java.lang.Double>
Overrides:
getDependentParamMetadataString in class AbstractParameter<java.lang.Double>
Returns:

isNullAllowed

public boolean isNullAllowed()
Description copied from class: AbstractParameter
Proxy function call to the constraint to see if null values are permitted

Specified by:
isNullAllowed in interface Parameter<java.lang.Double>
Overrides:
isNullAllowed in class AbstractParameter<java.lang.Double>

getTrans

public TranslatorAPI getTrans()

toXMLMetadata

public Element toXMLMetadata(Element root)
Specified by:
toXMLMetadata in interface XMLSaveable
Overrides:
toXMLMetadata in class AbstractParameter<java.lang.Double>

toXMLMetadata

public Element toXMLMetadata(Element root,
                             java.lang.String elementName)
Description copied from interface: Parameter
Saves this parameter into the supplied XML metadata Element using the specified name instead of the default.

Specified by:
toXMLMetadata in interface Parameter<java.lang.Double>
Overrides:
toXMLMetadata in class AbstractParameter<java.lang.Double>
Returns:

getEditor

public ParameterEditor<java.lang.Double> getEditor()
Description copied from interface: Parameter
Returns the Editor for this Parameter. It is recommended that editors be lazily instantiated.

Specified by:
getEditor in interface Parameter<java.lang.Double>
Overrides:
getEditor in class DoubleParameter
Returns:
the Editor