org.opensha.sha.imr.param.PropagationEffectParams
Class DistanceRupParameter

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<E>
      extended by org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter<Double>
          extended by org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
              extended by org.opensha.sha.imr.param.PropagationEffectParams.DistanceRupParameter
All Implemented Interfaces:
Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<Double>, WarningParameter<Double>, PropagationEffectParameterAPI<Double>

public class DistanceRupParameter
extends AbstractDoublePropEffectParam

Title: DistanceRupParameter

Description: Special subclass of PropagationEffectParameter. This finds the shortest distance to the fault surface.

Version:
1.0
Author:
Steven W. Rock
See Also:
DistanceJBParameter, DistanceSeisParameter, Serialized Form

Field Summary
protected static String C
          Class name used in debug strings
protected static boolean D
          If true debug statements are printed out
static String INFO
          Hardcoded info string
static String NAME
          Hardcoded name
static String UNITS
          Hardcoded units string
 
Fields inherited from class org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
ignoreWarning, warningConstraint, warningListeners
 
Fields inherited from class org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter
eqkRupture, site
 
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
DistanceRupParameter()
          No-Arg constructor that calls init().
DistanceRupParameter(double defaultValue)
          This constructor sets the default value.
DistanceRupParameter(ParameterConstraint warningConstraint)
          Constructor that sets up constraints.
DistanceRupParameter(ParameterConstraint warningConstraint, double defaultValue)
          Constructor that sets up constraints & the default value.
 
Method Summary
protected  void calcValueFromSiteAndEqkRup()
          Note that this doesn't not throw a warning
 Object clone()
          Returns a copy so you can't edit or damage the origial.
static double getDistance(Location loc, RuptureSurface rupSurf)
          This is a utility method that is not actually used in this class (it's for other classes).
 String getType()
          This is used to determine what widget editor to use in GUI Applets.
protected  void init()
          Sets the warning constraint to null, then initializes the absolute constraint
protected  void init(DoubleConstraint warningConstraint)
          Sets default fields on the Constraint, such as info and units.
 boolean setIndividualParamValueFromXML(Element el)
          This should set the value of this individual parameter.
 
Methods inherited from class org.opensha.sha.imr.param.PropagationEffectParams.AbstractDoublePropEffectParam
addParameterChangeWarningListener, compareTo, equals, fireParameterChangeWarning, getEditor, getWarningConstraint, getWarningMax, getWarningMin, isIgnoreWarning, isRecommended, removeParameterChangeWarningListener, setIgnoreWarning, setValue, setValueIgnoreWarning, setWarningConstraint
 
Methods inherited from class org.opensha.sha.imr.param.PropagationEffectParams.PropagationEffectParameter
getValue, setValue
 
Methods inherited from class org.opensha.commons.param.AbstractParameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, checkEditable, containsIndependentParameter, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, 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
 
Methods inherited from interface org.opensha.commons.param.Parameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, containsIndependentParameter, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setIndependentParameters, setInfo, setName, setNonEditable, setUnits, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, unableToSetValue
 
Methods inherited from interface org.opensha.commons.data.Named
getName
 
Methods inherited from interface org.opensha.commons.metadata.XMLSaveable
toXMLMetadata
 

Field Detail

C

protected static final String C
Class name used in debug strings

See Also:
Constant Field Values

D

protected static final boolean D
If true debug statements are printed out

See Also:
Constant Field Values

NAME

public static final String NAME
Hardcoded name

See Also:
Constant Field Values

UNITS

public static final String UNITS
Hardcoded units string

See Also:
Constant Field Values

INFO

public static final String INFO
Hardcoded info string

See Also:
Constant Field Values
Constructor Detail

DistanceRupParameter

public DistanceRupParameter()
No-Arg constructor that calls init(). No constraint so all values are allowed.


DistanceRupParameter

public DistanceRupParameter(double defaultValue)
This constructor sets the default value.


DistanceRupParameter

public DistanceRupParameter(ParameterConstraint warningConstraint)
                     throws ConstraintException
Constructor that sets up constraints. This is a constrained parameter.

Throws:
ConstraintException

DistanceRupParameter

public DistanceRupParameter(ParameterConstraint warningConstraint,
                            double defaultValue)
                     throws ConstraintException
Constructor that sets up constraints & the default value. This is a constrained parameter.

Throws:
ConstraintException
Method Detail

init

protected void init(DoubleConstraint warningConstraint)
Sets default fields on the Constraint, such as info and units.


init

protected void init()
Sets the warning constraint to null, then initializes the absolute constraint


calcValueFromSiteAndEqkRup

protected void calcValueFromSiteAndEqkRup()
Note that this doesn't not throw a warning

Specified by:
calcValueFromSiteAndEqkRup in class PropagationEffectParameter<Double>

getDistance

public static double getDistance(Location loc,
                                 RuptureSurface rupSurf)
This is a utility method that is not actually used in this class (it's for other classes). Note that this assumes the location is at the earth's surface (or at least above the rupSurface)

Parameters:
loc -
rupSurf -
Returns:

getType

public String getType()
This is used to determine what widget editor to use in GUI Applets.

Specified by:
getType in interface Parameter<Double>
Overrides:
getType in class PropagationEffectParameter<Double>

clone

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

Note: this is not a true clone. I did not clone Site or ProbEqkRupture. PE could potentially have a million points, way to expensive to clone. Should not be a problem though because once the PE and Site are set, they can not be modified by this class. The clone has null Site and PE parameters.

This will probably have to be changed in the future once the use of a clone is needed and we see the best way to implement this.

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

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<Double>
Returns: