org.opensha.commons.param.impl
Class CPTParameter
java.lang.Object
org.opensha.commons.param.AbstractParameter<CPT>
org.opensha.commons.param.impl.CPTParameter
- All Implemented Interfaces:
- Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<CPT>
public class CPTParameter
- extends AbstractParameter<CPT>
- See Also:
- Serialized Form
| Fields inherited from class org.opensha.commons.param.AbstractParameter |
C, constraint, D, defaultValue, editable, independentParameters, info, metadataString, name, units, value, XML_COMPLEX_VAL_EL_NAME, XML_GROUP_METADATA_NAME, XML_METADATA_NAME, XML_NULL_VALUE |
|
Method Summary |
Object |
clone()
Returns a copy so you can't edit or damage the origial. |
ParameterEditor<CPT> |
getEditor()
Returns the Editor for this Parameter. |
void |
setByName(String name)
Sets the value of the parameter by name, using the allowed items in the constraint. |
protected boolean |
setIndividualParamValueFromXML(Element el)
This should set the value of this individual parameter. |
void |
setValue(String name)
This is a convenience method for setting the value by name rather than passing in an object
(and that object has to be the same instance, not an object of the same name) |
| Methods inherited from class org.opensha.commons.param.AbstractParameter |
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, checkEditable, compareTo, containsIndependentParameter, equals, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersIterator, getIndependentParametersKey, getInfo, getMetadataString, getName, getNumIndependentParameters, getType, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setDependentParamMetadataString, setIndependentParameters, setIndepParamsFromXML, setInfo, setName, setNonEditable, setUnits, setValue, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, toXMLMetadata, unableToSetValue, valueToXML |
CPTParameter
public CPTParameter(String name)
CPTParameter
public CPTParameter(String name,
CPT value)
CPTParameter
public CPTParameter(String name,
List<CPT> allowed,
CPT value)
CPTParameter
public CPTParameter(String name,
ListBasedConstraint<CPT> constraint,
CPT value)
getEditor
public ParameterEditor<CPT> getEditor()
- Description copied from interface:
Parameter
- Returns the
Editor for this Parameter. It is
recommended that editors be lazily instantiated.
- Returns:
- the
Editor
setIndividualParamValueFromXML
protected 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<CPT>
- Returns:
setByName
public void setByName(String name)
throws NoSuchElementException,
UnsupportedOperationException
- Sets the value of the parameter by name, using the allowed items in the constraint.
- Parameters:
name -
- Throws:
NoSuchElementException - if a constraint exists, but no CPT in the allowed list matches the name
UnsupportedOperationException - if no valid constraint exists
setValue
public void setValue(String name)
- This is a convenience method for setting the value by name rather than passing in an object
(and that object has to be the same instance, not an object of the same name)
- Parameters:
name -
clone
public Object clone()
- Description copied from class:
AbstractParameter
- Returns a copy so you can't edit or damage the origial.
- Specified by:
clone in interface Parameter<CPT>- Specified by:
clone in class AbstractParameter<CPT>