org.opensha.sha.imr.param.OtherParams
Class TectonicRegionTypeParam
java.lang.Object
org.opensha.commons.param.AbstractParameter<String>
org.opensha.commons.param.impl.StringParameter
org.opensha.sha.imr.param.OtherParams.TectonicRegionTypeParam
- All Implemented Interfaces:
- Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<String>
public class TectonicRegionTypeParam
- extends StringParameter
This Tectonic Region Type Param is a string representation of our TectonicRegionType enum
(located in org.opensha.sha.util). The options to be supported in any given instance are
supplied via the string constraint supplied in the constructor. However, no options other
than what's defined by the TectonicRegionType enum are allowed.
See constructors for info on editability and default values.
Note that this is not in the EqkRuptureParams directory because it will not
be set from information in and EqkRupture object (the latter does not carry this info).
- See Also:
- Serialized Form
| 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 |
|
Method Summary |
TectonicRegionType |
getValueAsTRT()
Convenience method for getting the value as a TectonicRegionType
Same as calling TectonicRegionType.getTypeForName(trtParam.getValue()) |
static boolean |
isTypePotentiallySupported(String option)
This checks whether a type is potentially supported by this class
(whether an instance could support it, as opposed to whether an instance
does support it (the latter being controlled by the string constraint). |
void |
setValue(TectonicRegionType trt)
Convenience method for setting value directly from a TectonicRegionType. |
| 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, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setDefaultValue, setDependentParamMetadataString, setIndependentParameters, setIndepParamsFromXML, setInfo, setName, setNonEditable, setUnits, setValue, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, toXMLMetadata, unableToSetValue, valueToXML |
NAME
public static final String NAME
- See Also:
- Constant Field Values
INFO
public static final String INFO
- See Also:
- Constant Field Values
TectonicRegionTypeParam
public TectonicRegionTypeParam()
- This no-argument constructor defaults to only Active Shallow Crust,
and sets the parameter as non editable.
TectonicRegionTypeParam
public TectonicRegionTypeParam(StringConstraint options,
String defaultValue)
- This constructor will throw an exception if the options contain a non-allowed
type (as represented by the TYPE_* fields here). The parameter is set as non editable
after creation
- Parameters:
options - defaultValue -
TectonicRegionTypeParam
public TectonicRegionTypeParam(Collection<TectonicRegionType> options,
TectonicRegionType defaultValue)
setValue
public void setValue(TectonicRegionType trt)
- Convenience method for setting value directly from a
TectonicRegionType.
Same as calling setValue(trt.toString())
- Parameters:
trt - - the TectonicRegionType to be set
getValueAsTRT
public TectonicRegionType getValueAsTRT()
- Convenience method for getting the value as a
TectonicRegionType
Same as calling TectonicRegionType.getTypeForName(trtParam.getValue())
- Returns:
isTypePotentiallySupported
public static boolean isTypePotentiallySupported(String option)
- This checks whether a type is potentially supported by this class
(whether an instance could support it, as opposed to whether an instance
does support it (the latter being controlled by the string constraint).
- Parameters:
option -
- Returns:
- boolean