org.nlogo.agent
Interface ValueConstraint

All Known Implementing Classes:
BooleanConstraint, ChooserConstraint, ConstantSliderConstraint, DynamicSliderConstraint, InputBoxConstraint, SliderConstraint

public interface ValueConstraint

Interface for objects which provide constraints for values.


Nested Class Summary
static class ValueConstraint.Violation
           
 
Method Summary
 void assertConstraint(Object val)
          Throws a Violation condition if the input is not acceptable.
 Object coerceValue(Object val)
          Returns the constrained value, which can differ from the input.
 Object defaultValue()
          Returns the default value for this constraint
 

Method Detail

assertConstraint

void assertConstraint(Object val)
                      throws ValueConstraint.Violation,
                             LogoException
Throws a Violation condition if the input is not acceptable.

Throws:
ValueConstraint.Violation
LogoException

coerceValue

Object coerceValue(Object val)
                   throws ValueConstraint.Violation,
                          LogoException
Returns the constrained value, which can differ from the input. Throws a Violation condition if the input is not coercable.

Throws:
ValueConstraint.Violation
LogoException

defaultValue

Object defaultValue()
Returns the default value for this constraint