org.opensha.sha.imr.param.IntensityMeasureParams
Class PeriodParam

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<Double>
      extended by org.opensha.commons.param.impl.DoubleDiscreteParameter
          extended by org.opensha.sha.imr.param.IntensityMeasureParams.PeriodParam
All Implemented Interfaces:
Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<Double>

public class PeriodParam
extends DoubleDiscreteParameter

This represents Period for the Spectral Acceleration parameter (SA_Param). The constructor requires a list of supported periods (in the form of a DoubleDiscreteConstraint). Once instantiated, this can be added to the SA_Param as an independent parameter. See constructors for info on editability and default values.

Author:
field
See Also:
Serialized Form

Field Summary
static String INFO
           
static String NAME
           
static String UNITS
           
 
Fields inherited from class org.opensha.commons.param.impl.DoubleDiscreteParameter
C, D
 
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
PeriodParam(DoubleDiscreteConstraint peroidList)
          This sets the default as 1.0 and leaves the parameter non editable
PeriodParam(DoubleDiscreteConstraint peroidList, double defaultPeriod, boolean leaveEditable)
          This is the most general constructor
 
Method Summary
 double getMaxPeriod()
          This assumes the list is always in order (is this correct?)
 double getMinPeriod()
          This assumes the list is always in order (is this correct?)
 double[] getPeriods()
           
 List<Double> getSupportedPeriods()
          Helper method to quickly get the supported periods.
 
Methods inherited from class org.opensha.commons.param.impl.DoubleDiscreteParameter
clone, getAllowedDoubles, getEditor, getType, setConstraint, 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, getMetadataString, getName, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, 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
 
Methods inherited from interface org.opensha.commons.param.Parameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, containsIndependentParameter, equals, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, getNumIndependentParameters, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setDefaultValue, setIndependentParameters, setInfo, setName, setNonEditable, setUnits, setValue, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, unableToSetValue
 
Methods inherited from interface org.opensha.commons.data.Named
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.opensha.commons.metadata.XMLSaveable
toXMLMetadata
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

UNITS

public static final String UNITS
See Also:
Constant Field Values

INFO

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

PeriodParam

public PeriodParam(DoubleDiscreteConstraint peroidList,
                   double defaultPeriod,
                   boolean leaveEditable)
This is the most general constructor

Parameters:
peroidList - - desired constraints
defaultPeriod - - desired default value
leaveEditable - - whether or not to leave editable

PeriodParam

public PeriodParam(DoubleDiscreteConstraint peroidList)
This sets the default as 1.0 and leaves the parameter non editable

Parameters:
peroidList -
Method Detail

getSupportedPeriods

public List<Double> getSupportedPeriods()
Helper method to quickly get the supported periods.

Returns:

getMinPeriod

public double getMinPeriod()
This assumes the list is always in order (is this correct?)

Returns:

getMaxPeriod

public double getMaxPeriod()
This assumes the list is always in order (is this correct?)

Returns:

getPeriods

public double[] getPeriods()