org.opensha.sha.param
Class MagFreqDistConstraint

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

public class MagFreqDistConstraint
extends AbstractParameterConstraint

Title: MagFreqDistConstraint

Description: Constraint Object containing IncrementalMagFreqDist object and list of allowed MagFreqDists to be shown in GUI

Version:
1.0
Author:
Vipin Gupta, Nitin Gupta
See Also:
Serialized Form

Field Summary
protected static String C
          Class name for debugging.
protected static boolean D
          If true print out debug statements.
 
Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint
editable, name, nullAllowed
 
Constructor Summary
MagFreqDistConstraint()
          No-Arg Constructor, constraints are null so all values allowed
MagFreqDistConstraint(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.
 ArrayList getAllowedMagDists()
          Returns the vector of allowed Mag Dists
 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.
 boolean isAllowed(String distName)
          Checks if the passed in distribution name is allowed First the value is chekced if it's null and null values are allowed.
 String toString()
          Returns the classname of the constraint, and the allowed Mag dist Names as a debug string
 
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
 

Field Detail

C

protected static final String C
Class name for debugging.

See Also:
Constant Field Values

D

protected static final boolean D
If true print out debug statements.

See Also:
Constant Field Values
Constructor Detail

MagFreqDistConstraint

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


MagFreqDistConstraint

public MagFreqDistConstraint(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

getAllowedMagDists

public ArrayList getAllowedMagDists()
Returns the vector of allowed Mag Dists


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.

Parameters:
obj - The object to check if allowed.
Returns:
True if this is an String and one of the allowed values.

isAllowed

public boolean isAllowed(String distName)
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.

Parameters:
distName - Distribution name
Returns:
True if this is an String and one of the allowed values.

toString

public String toString()
Returns the classname of the constraint, and the allowed Mag dist Names as a debug string

Overrides:
toString in class Object

clone

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

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