org.nlogo.agent
Class InputBoxConstraint

java.lang.Object
  extended by org.nlogo.agent.InputBoxConstraint
All Implemented Interfaces:
ValueConstraint

public class InputBoxConstraint
extends Object
implements ValueConstraint


Nested Class Summary
static interface InputBoxConstraint.InputBoxTypeInterface
           
 
Nested classes/interfaces inherited from interface org.nlogo.agent.ValueConstraint
ValueConstraint.Violation
 
Constructor Summary
InputBoxConstraint(InputBoxConstraint.InputBoxTypeInterface type)
           
InputBoxConstraint(Object defaultValue, InputBoxConstraint.InputBoxTypeInterface type)
           
 
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
 void defaultValue(Object def)
           
 void setType(String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputBoxConstraint

public InputBoxConstraint(InputBoxConstraint.InputBoxTypeInterface type)

InputBoxConstraint

public InputBoxConstraint(Object defaultValue,
                          InputBoxConstraint.InputBoxTypeInterface type)
Method Detail

setType

public void setType(String name)

defaultValue

public Object defaultValue()
Description copied from interface: ValueConstraint
Returns the default value for this constraint

Specified by:
defaultValue in interface ValueConstraint

defaultValue

public void defaultValue(Object def)

assertConstraint

public void assertConstraint(Object val)
                      throws ValueConstraint.Violation,
                             LogoException
Description copied from interface: ValueConstraint
Throws a Violation condition if the input is not acceptable.

Specified by:
assertConstraint in interface ValueConstraint
Throws:
ValueConstraint.Violation
LogoException

coerceValue

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

Specified by:
coerceValue in interface ValueConstraint
Throws:
LogoException