org.opensha.commons.param.impl
Class EvenlyDiscretizedFuncParameter

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<EvenlyDiscretizedFunc>
      extended by org.opensha.commons.param.impl.EvenlyDiscretizedFuncParameter
All Implemented Interfaces:
Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<EvenlyDiscretizedFunc>

public class EvenlyDiscretizedFuncParameter
extends AbstractParameter<EvenlyDiscretizedFunc>

Title: EvenlyDiscretizedFuncParameter.java

Description: This parameter accepts a EvenlyDiscretizedFunc as a value. It shows the GUI so that user can enter min/max/num values and then the correspoding Y values for the EvelyDiscretizedFunc This class has 2 methods for setting the units : 1. setUnits() : This method sets the units for Y values 2. setXUnits(): This method sets the units for X values. Similarly, we have 2 different methods for getting the units.

Version:
1.0
Author:
: Nitin Gupta and Vipin Gupta
See Also:
Serialized Form

Field Summary
protected static String C
          Class name for debugging.
protected static boolean D
          If true print out debug statements.
static String MAX_PARAM_NAME
           
static String MIN_PARAM_NAME
           
static String NUM_PARAM_NAME
           
protected static String PARAM_TYPE
           
 
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
 
Constructor Summary
EvenlyDiscretizedFuncParameter(String name, EvenlyDiscretizedFunc discretizedFunc)
          No constraints specified, all values allowed.
 
Method Summary
 Object clone()
          Returns a copy so you can't edit or damage the origial.
 AbstractParameterEditorOld getEditor()
          Returns the Editor for this Parameter.
 ParameterList getEvenlyDiscretizedParams()
          gets the ParameterList for the EvenlyDiscretized parameter
 String getMetadataString()
          This overrides the getmetadataString() method because the value here does not have an ASCII representation (and we need to know the values of the independent parameter instead).
 EvenlyDiscretizedFunc getParameter()
           
 String getType()
          Returns the name of the parameter class
 String getXUnits()
          Returns the units of X values for this parameter.
 boolean setIndividualParamValueFromXML(Element el)
          This should set the value of this individual parameter.
 void setXUnits(String units)
          Sets the units for X Values.
 
Methods inherited from class org.opensha.commons.param.AbstractParameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, checkEditable, compareTo, containsIndependentParameter, equals, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getName, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setDependentParamMetadataString, setIndependentParameters, setIndepParamsFromXML, setInfo, setName, setNonEditable, setUnits, setValue, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, toXMLMetadata, unableToSetValue, valueToXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

protected static final 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

PARAM_TYPE

protected static final String PARAM_TYPE
See Also:
Constant Field Values

MIN_PARAM_NAME

public static final String MIN_PARAM_NAME
See Also:
Constant Field Values

MAX_PARAM_NAME

public static final String MAX_PARAM_NAME
See Also:
Constant Field Values

NUM_PARAM_NAME

public static final String NUM_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

EvenlyDiscretizedFuncParameter

public EvenlyDiscretizedFuncParameter(String name,
                                      EvenlyDiscretizedFunc discretizedFunc)
No constraints specified, all values allowed. Sets the name and value.

Parameters:
name - Name of the parameter
discretizedFunc - DiscretizedFunc object
Method Detail

getEvenlyDiscretizedParams

public ParameterList getEvenlyDiscretizedParams()
gets the ParameterList for the EvenlyDiscretized parameter

Returns:
ParameterList

setXUnits

public void setXUnits(String units)
               throws EditableException
Sets the units for X Values. To set the units for Y values, use the setUnits() method

Throws:
EditableException

getXUnits

public String getXUnits()
Returns the units of X values for this parameter. To get the units for Y values, use getUnits() method represented as a String.


clone

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

Specified by:
clone in interface Parameter<EvenlyDiscretizedFunc>
Specified by:
clone in class AbstractParameter<EvenlyDiscretizedFunc>
Returns:
Exact copy of this object's state

getParameter

public EvenlyDiscretizedFunc getParameter()
Returns:
the EvenlyDiscretizedFunc contained in this parameter

getType

public String getType()
Returns the name of the parameter class

Specified by:
getType in interface Parameter<EvenlyDiscretizedFunc>
Overrides:
getType in class AbstractParameter<EvenlyDiscretizedFunc>

getMetadataString

public String getMetadataString()
This overrides the getmetadataString() method because the value here does not have an ASCII representation (and we need to know the values of the independent parameter instead).

Specified by:
getMetadataString in interface Parameter<EvenlyDiscretizedFunc>
Overrides:
getMetadataString in class AbstractParameter<EvenlyDiscretizedFunc>
Returns:
Sstring

setIndividualParamValueFromXML

public boolean setIndividualParamValueFromXML(Element el)
Description copied from class: AbstractParameter
This should set the value of this individual parameter. The values of the independent parameters will be set by the final setValueFromXMLMetadata method

Specified by:
setIndividualParamValueFromXML in class AbstractParameter<EvenlyDiscretizedFunc>
Returns:

getEditor

public AbstractParameterEditorOld getEditor()
Description copied from interface: Parameter
Returns the Editor for this Parameter. It is recommended that editors be lazily instantiated.

Returns:
the Editor