org.opensha.commons.param.constraint.impl
Class IntegerDiscreteConstraint

java.lang.Object
  extended by org.opensha.commons.param.constraint.AbstractParameterConstraint<Integer>
      extended by org.opensha.commons.param.constraint.impl.IntegerDiscreteConstraint
All Implemented Interfaces:
Serializable, Named, ParameterConstraint<Integer>

public class IntegerDiscreteConstraint
extends AbstractParameterConstraint<Integer>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.commons.param.constraint.AbstractParameterConstraint
C, D, editable, name, nullAllowed
 
Constructor Summary
IntegerDiscreteConstraint(ArrayList<Integer> allowed)
           
 
Method Summary
 void addAllowed(Integer val)
           
 Object clone()
          Returns a copy so you can't edit or damage the origial.
 ArrayList<Integer> getAllowed()
           
 boolean isAllowed(Integer obj)
          Determine if the new value being set is allowed.
 void setAllowed(ArrayList<Integer> allowed)
           
 int size()
           
 
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, toString, wait, wait, wait
 

Constructor Detail

IntegerDiscreteConstraint

public IntegerDiscreteConstraint(ArrayList<Integer> allowed)
Method Detail

setAllowed

public void setAllowed(ArrayList<Integer> allowed)

isAllowed

public boolean isAllowed(Integer obj)
Description copied from interface: ParameterConstraint
Determine if the new value being set is allowed.

Parameters:
obj - Object to check if allowed via constraints.
Returns:
True if the value is allowed.

clone

public Object clone()
Description copied from class: AbstractParameterConstraint
Returns a copy so you can't edit or damage the origial. All concrete subclasses must implement this.

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

getAllowed

public ArrayList<Integer> getAllowed()

addAllowed

public void addAllowed(Integer val)

size

public int size()