org.opensha.sha.param
Class MagPDF_Constraint

java.lang.Object
  extended by org.opensha.commons.param.constraint.AbstractParameterConstraint
      extended by org.opensha.sha.param.MagFreqDistConstraint
          extended by org.opensha.sha.param.MagPDF_Constraint
All Implemented Interfaces:
Serializable, Named, ParameterConstraint

public class MagPDF_Constraint
extends MagFreqDistConstraint

Title: MagPDF_Constraint

Description: This extends MagFreqDistConstraint (contains a list of allowed IncrementalMagFreqDists) by checking that the total rate (or probability for the PDF) is equal to 1.0.

Version:
1.0
Author:
Ned Field
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.sha.param.MagFreqDistConstraint
C, D
 
Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint
editable, name, nullAllowed
 
Constructor Summary
MagPDF_Constraint()
          No-Arg Constructor, constraints are null so all values allowed
MagPDF_Constraint(ArrayList allowedVals)
          Constructor that sets the constraints during instantiation.
 
Method Summary
 Object clone()
          Creates a copy of this object instance so the original cannot be altered.
 boolean isAllowed(Object obj)
          Checks if the passed in distribution name is allowed First the value is chekced if it's null and null values are allowed.
 
Methods inherited from class org.opensha.sha.param.MagFreqDistConstraint
getAllowedMagDists, isAllowed, toString
 
Methods inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint
checkEditable, getName, isEditable, isNullAllowed, setName, setNonEditable, setNullAllowed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MagPDF_Constraint

public MagPDF_Constraint()
No-Arg Constructor, constraints are null so all values allowed


MagPDF_Constraint

public MagPDF_Constraint(ArrayList allowedVals)
Constructor that sets the constraints during instantiation. Sets the allowed MagFreqDists in this constraint

Parameters:
allowedVals - Vector of strings of allowed MagFreqDists
Method Detail

isAllowed

public boolean isAllowed(Object obj)
Checks if the passed in distribution name is allowed First the value is chekced if it's null and null values are allowed. Then it checks the passed in object is an String.

Specified by:
isAllowed in interface ParameterConstraint
Overrides:
isAllowed in class MagFreqDistConstraint
Parameters:
obj - The object to check if allowed.
Returns:
True if this is an String and one of the allowed values.

clone

public Object clone()
Creates a copy of this object instance so the original cannot be altered.

Specified by:
clone in interface ParameterConstraint
Overrides:
clone in class MagFreqDistConstraint
Returns:
Exact copy of this object's state.