org.opensha.sha.imr.param.OtherParams
Class TectonicRegionTypeParam

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<String>
      extended by org.opensha.commons.param.impl.StringParameter
          extended by 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

Field Summary
static String INFO
           
static String NAME
           
 
Fields inherited from class org.opensha.commons.param.impl.StringParameter
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
 
Constructor Summary
TectonicRegionTypeParam()
          This no-argument constructor defaults to only Active Shallow Crust, and sets the parameter as non editable.
TectonicRegionTypeParam(Collection<TectonicRegionType> options, TectonicRegionType defaultValue)
           
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).
TectonicRegionTypeParam(TectonicRegionType... types)
          This no-argument constructor defaults to only the given types.
 
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.impl.StringParameter
clone, getAllowedStrings, 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
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

INFO

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

TectonicRegionTypeParam

public TectonicRegionTypeParam()
This no-argument constructor defaults to only Active Shallow Crust, and sets the parameter as non editable.


TectonicRegionTypeParam

public TectonicRegionTypeParam(TectonicRegionType... types)
This no-argument constructor defaults to only the given types. The first one given is considered default 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)
Method Detail

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