org.opensha.commons.param.impl
Class TreeBranchWeightsParameter

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

public class TreeBranchWeightsParameter
extends ParameterListParameter

Title: TreeBranchWeightsParameter

Description: This is a new parameter which contains the parameterList of the different weights for the branches

Version:
1.0
Author:
: Edward (Ned) Field, 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.
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
TreeBranchWeightsParameter(String name)
          No constraints specified for this parameter.
TreeBranchWeightsParameter(String name, ParameterList paramList)
          No constraints specified, all values allowed.
 
Method Summary
 boolean doWeightsSumToOne(ParameterList paramList)
           
 ParameterEditor<ParameterList> getEditor()
          Returns the Editor for this Parameter.
 double getTolerance()
          gets the tolerence for the sum of branch weights
 String getType()
          Returns the name of the parameter class
 void setTolerence(double tolerance)
          sets the tolerance for the sums of the weights
 void setValue(ParameterList value)
          Set's the parameter's value.
 
Methods inherited from class org.opensha.commons.param.impl.ParameterListParameter
clone, getMetadataString, getParameter, getParametersIterator, setIndividualParamValueFromXML
 
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, 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
Constructor Detail

TreeBranchWeightsParameter

public TreeBranchWeightsParameter(String name)
No constraints specified for this parameter. Sets the name of this parameter.

Parameters:
name - Name of the parameter

TreeBranchWeightsParameter

public TreeBranchWeightsParameter(String name,
                                  ParameterList paramList)
No constraints specified, all values allowed. Sets the name and value.

Parameters:
name - Name of the parameter
paramList - ParameterList object
Method Detail

setTolerence

public void setTolerence(double tolerance)
sets the tolerance for the sums of the weights

Parameters:
tolerance -

getTolerance

public double getTolerance()
gets the tolerence for the sum of branch weights

Returns:

setValue

public void setValue(ParameterList value)
              throws ParameterException
Set's the parameter's value. It checks that all the weights Parameter in this parameterList should be DoubleParameter.

Specified by:
setValue in interface Parameter<ParameterList>
Overrides:
setValue in class ParameterListParameter
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

doWeightsSumToOne

public boolean doWeightsSumToOne(ParameterList paramList)
Returns:
true if the Branch Weight Values sum to One, inside the parameterList lie within the range of "1". else return false.

getType

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

Specified by:
getType in interface Parameter<ParameterList>
Overrides:
getType in class ParameterListParameter

getEditor

public ParameterEditor<ParameterList> 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<ParameterList>
Overrides:
getEditor in class ParameterListParameter
Returns:
the Editor