org.opensha.commons.param.constraint
Interface ParameterConstraint<E>

All Superinterfaces:
Named, Serializable
All Known Subinterfaces:
DiscreteParameterConstraint<E>
All Known Implementing Classes:
AbstractParameterConstraint, DoubleConstraint, DoubleDiscreteConstraint, DoubleValueWeightConstraint, EditableStringConstraint, EnumConstraint, EstimateConstraint, IntegerConstraint, IntegerDiscreteConstraint, ListBasedConstraint, LocationConstraint, LongConstraint, MagFreqDistConstraint, MagPDF_Constraint, StringConstraint, StringListConstraint

public interface ParameterConstraint<E>
extends Named, Serializable

Title: ParameterConstraintAPI

Description: This is the interface that all constraints must implement. Constraints store such information as if a value is allowed, if the data is editable, i.e. functions that restrict or allow setting new values on parameters.

Version:
1.0
Author:
Sid Hellman, Steven W. Rock

Method Summary
 Object clone()
          Returns a copy so you can't edit or damage the origial.
 String getName()
          Every parameter constraint has a name, this function returns that name.
 boolean isAllowed(E obj)
          Determine if the new value being set is allowed.
 boolean isEditable()
          Determines if the value can be edited, i.e.
 boolean isNullAllowed()
          A parameter may or may not allow null values.
 void setName(String name)
          Every parameter constraint has a name, this function sets that name.
 void setNonEditable()
          Disables editing the value once it is set.
 void setNullAllowed(boolean nullAllowed)
          A parameter may or may not allow null values.
 

Method Detail

getName

String getName()
Every parameter constraint has a name, this function returns that name.

Specified by:
getName in interface Named

setName

void setName(String name)
             throws EditableException
Every parameter constraint has a name, this function sets that name.

Throws:
EditableException

isAllowed

boolean isAllowed(E obj)
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.

isEditable

boolean isEditable()
Determines if the value can be edited, i.e. changed once set.

Returns:
The editable value.

setNonEditable

void setNonEditable()
Disables editing the value once it is set.


clone

Object clone()
Returns a copy so you can't edit or damage the origial.

Returns:
Exact copy of this object's state.

setNullAllowed

void setNullAllowed(boolean nullAllowed)
                    throws EditableException
A parameter may or may not allow null values. That permission is set here.

Throws:
EditableException

isNullAllowed

boolean isNullAllowed()
A parameter may or may not allow null values. That permission is checked here.