org.nlogo.agent
Class SliderConstraint
java.lang.Object
org.nlogo.agent.SliderConstraint
- All Implemented Interfaces:
- ValueConstraint
- Direct Known Subclasses:
- ConstantSliderConstraint, DynamicSliderConstraint
public abstract class SliderConstraint
- extends Object
- implements ValueConstraint
SliderConstraint
public SliderConstraint()
updateConstraint
public abstract void updateConstraint()
throws CompilerException,
LogoException
- Specified by:
updateConstraint
in interface ValueConstraint
- Throws:
CompilerException
LogoException
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 CompilerException,
LogoException
- Throws:
CompilerException
LogoException