org.nlogo.agent
Class SliderConstraint

java.lang.Object
  extended by org.nlogo.agent.SliderConstraint
All Implemented Interfaces:
ValueConstraint
Direct Known Subclasses:
ConstantSliderConstraint, DynamicSliderConstraint

public abstract class SliderConstraint
extends Object
implements ValueConstraint


Nested Class Summary
static class SliderConstraint.ConstraintCompilerException
           
static class SliderConstraint.RuntimeConstraintException
           
 
Nested classes/interfaces inherited from interface org.nlogo.agent.ValueConstraint
ValueConstraint.Violation
 
Constructor Summary
SliderConstraint()
           
 
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(Double defaultValue)
           
 Double effectiveMaximum()
           
 int getPrecision()
           
abstract  Double increment()
           
static SliderConstraint makeSliderConstraint(Agent agent, String minSpec, String maxSpec, String incSpec, Double defValue, Object owner)
           
abstract  Double maximum()
           
abstract  Double minimum()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SliderConstraint

public SliderConstraint()
Method Detail

minimum

public abstract Double minimum()
                        throws LogoException
Throws:
LogoException

maximum

public abstract Double maximum()
                        throws LogoException
Throws:
LogoException

increment

public abstract Double increment()
                          throws LogoException
Throws:
LogoException

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(Double defaultValue)

effectiveMaximum

public Double effectiveMaximum()
                        throws LogoException
Throws:
LogoException

getPrecision

public int getPrecision()

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

makeSliderConstraint

public static SliderConstraint makeSliderConstraint(Agent agent,
                                                    String minSpec,
                                                    String maxSpec,
                                                    String incSpec,
                                                    Double defValue,
                                                    Object owner)
                                             throws SliderConstraint.ConstraintCompilerException,
                                                    LogoException
Throws:
SliderConstraint.ConstraintCompilerException
LogoException