|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.param.AbstractParameter<Double>
org.opensha.commons.param.impl.DoubleParameter
public class DoubleParameter
Title: DoubleParameter
Description: Generic Data Object that contains a Double and optionally a min and max allowed values stored in a constraint object. If no constraint object is present then all values should be permitted.
| Field Summary | |
|---|---|
protected static String |
C
Class name for debugging. |
protected static boolean |
D
If true print out debug statements. |
| 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 | |
|---|---|
DoubleParameter(String name)
No constraints specified, all values allowed. |
|
DoubleParameter(String name,
Double value)
No constraints specified, all values allowed. |
|
DoubleParameter(String name,
DoubleConstraint constraint)
Sets the name and Constraints object. |
|
DoubleParameter(String name,
DoubleConstraint constraint,
Double value)
Sets the name, value and constraint. |
|
DoubleParameter(String name,
DoubleConstraint constraint,
String units)
Sets the name, constraints, and sets the units. |
|
DoubleParameter(String name,
DoubleConstraint constraint,
String units,
Double value)
This is the main constructor. |
|
DoubleParameter(String name,
double min,
double max)
Sets the name, defines the constraints min and max values. |
|
DoubleParameter(String name,
Double min,
Double max)
Sets the name, defines the constraints min and max values. |
|
DoubleParameter(String name,
double min,
double max,
Double value)
Sets the name, and value. |
|
DoubleParameter(String name,
Double min,
Double max,
Double value)
Sets the name, and value. |
|
DoubleParameter(String name,
double min,
double max,
String units)
Sets the name, defines the constraints min and max values, and sets the units. |
|
DoubleParameter(String name,
Double min,
Double max,
String units)
Sets the name, defines the constraints min and max values, and sets the units. |
|
DoubleParameter(String name,
double min,
double max,
String units,
Double value)
Sets all values, and the constraint is created from the min and max values. |
|
DoubleParameter(String name,
Double min,
Double max,
String units,
Double value)
Sets all values, and the constraint is created from the min and max values. |
|
DoubleParameter(String name,
String units)
No constraints specified, all values allowed. |
|
DoubleParameter(String name,
String units,
Double value)
Sets the name, units and value. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a copy so you can't edit or damage the origial. |
ParameterEditor<Double> |
getEditor()
Returns the Editor for this Parameter. |
Double |
getMax()
Returns the maximum allowed values. |
Double |
getMin()
Gets the min value of the constraint object. |
String |
getType()
Gets the type of this parameter. |
boolean |
isAllowed(Double d)
Uses the constraint object to determine if the new value being set is allowed. |
void |
setConstraint(ParameterConstraint constraint)
Sets the constraint if it is a StringConstraint and the parameter is currently editable. |
boolean |
setIndividualParamValueFromXML(Element el)
Parses the given XML element for a double value and sets it |
void |
setValue(double value)
Set's the parameter's value. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String C
protected static final boolean D
| Constructor Detail |
|---|
public DoubleParameter(String name)
name - Name of the parameter
public DoubleParameter(String name,
String units)
name - Name of the parameterunits - Units of this parameter
public DoubleParameter(String name,
double min,
double max)
throws ConstraintException
name - Name of the parametermin - defines min of allowed valuesmax - defines max of allowed values
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
double min,
double max,
String units)
throws ConstraintException
name - Name of the parametermin - defines min of allowed valuesmax - defines max of allowed valuesunits - Units of this parameter
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
Double min,
Double max)
throws ConstraintException
name - Name of the parametermin - defines min of allowed valuesmax - defines max of allowed values
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
Double min,
Double max,
String units)
throws ConstraintException
name - Name of the parametermin - defines min of allowed valuesmax - defines max of allowed valuesunits - Units of this parameter
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
DoubleConstraint constraint)
throws ConstraintException
name - Name of the parameterconstraint - defines min and max range of allowed
values
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
DoubleConstraint constraint,
String units)
throws ConstraintException
name - Name of the parameterconstraint - defines min and max range of allowed
valuesunits - Units of this parameter
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not
allowedallowed one. Null values are always allowed in the
constructors
public DoubleParameter(String name,
Double value)
name - Name of the parametervalue - Double value of this parameter
public DoubleParameter(String name,
String units,
Double value)
throws ConstraintException
name - Name of the parametervalue - Double value of this parameterunits - Units of this parameter
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
double min,
double max,
Double value)
throws ConstraintException
name - Name of the parametervalue - Double value of this parametermin - defines max of allowed valuesmax - defines min of allowed values
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
Double min,
Double max,
Double value)
throws ConstraintException
name - Name of the parametervalue - Double value of this parametermin - defines max of allowed valuesmax - defines min of allowed values
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
DoubleConstraint constraint,
Double value)
throws ConstraintException
name - Name of the parameterconstraint - defines min and max range of allowed
valuesvalue - Double value of this parameter
ConstraintException - thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
double min,
double max,
String units,
Double value)
throws ConstraintException
name - Name of the parametervalue - Double value of this parametermin - defines min of allowed valuesmax - defines max of allowed valuesunits - Units of this parameter
ConstraintException - Is thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
Double min,
Double max,
String units,
Double value)
throws ConstraintException
name - Name of the parametervalue - Double value of this parametermin - defines min of allowed valuesmax - defines max of allowed valuesunits - Units of this parameter
ConstraintException - Is thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed
public DoubleParameter(String name,
DoubleConstraint constraint,
String units,
Double value)
throws ConstraintException
name - Name of the parameterconstraint - defines min and max range of allowed
valuesvalue - Double value of this parameterunits - Units of this parameter
ConstraintException - Is thrown if the value is not allowed
ConstraintException - Is thrown if the value is not allowed| Method Detail |
|---|
public void setConstraint(ParameterConstraint constraint)
throws ParameterException,
EditableException
setConstraint in interface Parameter<Double>setConstraint in class AbstractParameter<Double>constraint - The new constraint.
ParameterException - Thrown if constraint is not a DoubleConstraint.
EditableException - Thrown if the parameter is currently uneditable.
public Double getMin()
throws Exception
Exceptionpublic Double getMax()
public String getType()
getType in interface Parameter<Double>getType in class AbstractParameter<Double>
public void setValue(double value)
throws ConstraintException,
ParameterException
value - The new value for this Parameter
ParameterException - Thrown if the object is currenlty not
editable.
ConstraintException - Thrown if the object value is not allowed.public boolean isAllowed(Double d)
isAllowed in interface Parameter<Double>isAllowed in class AbstractParameter<Double>obj - Object to check if allowed via constraints
public Object clone()
clone in interface Parameter<Double>clone in class AbstractParameter<Double>public boolean setIndividualParamValueFromXML(Element el)
setIndividualParamValueFromXML in class AbstractParameter<Double>public ParameterEditor<Double> getEditor()
ParameterEditor for this Parameter. It is
recommended that editors be lazily instantiated.
Editor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||