org.opensha.commons.param.constraint.impl
Class ListBasedConstraint<E>
java.lang.Object
org.opensha.commons.param.constraint.AbstractParameterConstraint<E>
org.opensha.commons.param.constraint.impl.ListBasedConstraint<E>
- All Implemented Interfaces:
- Serializable, Named, ParameterConstraint<E>
public class ListBasedConstraint<E>
- extends AbstractParameterConstraint<E>
- See Also:
- Serialized Form
ListBasedConstraint
public ListBasedConstraint(List<E> allowed)
setAllowed
public void setAllowed(List<E> allowed)
getAllowed
public List<E> getAllowed()
isAllowed
public boolean isAllowed(E 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<E>- Specified by:
clone in class AbstractParameterConstraint<E>
- Returns:
- Exact copy of this object's state.