org.graffiti.plugin.parameter
Class AbstractLimitableParameter<T extends Comparable<T>>

java.lang.Object
  extended by org.graffiti.plugin.parameter.AbstractSingleParameter<T>
      extended by org.graffiti.plugin.parameter.AbstractLimitableParameter<T>
All Implemented Interfaces:
Serializable, Displayable<T>, LimitableParameter<T>, Parameter<T>, SingleParameter<T>
Direct Known Subclasses:
DoubleParameter, FloatParameter, IntegerParameter, ProbabilityParameter

public abstract class AbstractLimitableParameter<T extends Comparable<T>>
extends AbstractSingleParameter<T>
implements LimitableParameter<T>

This abstract class provides an implementation for the isValid method, using the compareTo method of the Comparable interface.

Version:
$Revision: 5767 $
See Also:
Serialized Form

Field Summary
protected  T max
          The parameter's maximum.
protected  T min
          The parameter's minimum.
protected  T sliderMax
          The parameter's slider maximum.
protected  T sliderMin
          The parameter's slider minimum.
 
Constructor Summary
AbstractLimitableParameter(String name, String description, T sliderMin, T sliderMax)
          Constructs a new abstract limitable parameter.
AbstractLimitableParameter(String name, String description, T sliderMin, T sliderMax, T min, T max)
          Constructs a new abstract limitable parameter.
AbstractLimitableParameter(T value, String name, String description)
          Constructs a new abstract limitable parameter.
AbstractLimitableParameter(T value, String name, String description, T sliderMin, T sliderMax)
          Constructs a new abstract limitable parameter.
AbstractLimitableParameter(T value, String name, String description, T sliderMin, T sliderMax, T min, T max)
          Constructs a new abstract limitable parameter.
 
Method Summary
 T getMax()
          Returns the maximum of the intervall.
 T getMin()
          Returns the minimum of the intervall.
 T getSliderMax()
          Returns the maximum of the intervall.
 T getSliderMin()
          Returns the minimum of the intervall.
 boolean isValid()
          Returns true if the value is between the minimum and the maximum, false otherwise.
 String toXMLString()
          Returns a well-formed XML string representing the Displayable.
 
Methods inherited from class org.graffiti.plugin.parameter.AbstractSingleParameter
canCopy, copy, getDependencyParent, getDependencyValue, getDescription, getImage, getName, getStandardXML, getValue, isVisible, setDependency, setDescription, setObjectValue, setValue, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.parameter.Parameter
canCopy, copy, getDependencyParent, getDependencyValue, getImage, isVisible, setDependency, setObjectValue, setVisible
 
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getName, getValue, setDescription, setValue
 

Field Detail

max

protected T extends Comparable<T> max
The parameter's maximum.


min

protected T extends Comparable<T> min
The parameter's minimum.


sliderMax

protected T extends Comparable<T> sliderMax
The parameter's slider maximum.


sliderMin

protected T extends Comparable<T> sliderMin
The parameter's slider minimum.

Constructor Detail

AbstractLimitableParameter

public AbstractLimitableParameter(T value,
                                  String name,
                                  String description)
Constructs a new abstract limitable parameter.

Parameters:
value - the value of the parameter.
name - the name of the parameter.
description - the description of the parameter.

AbstractLimitableParameter

public AbstractLimitableParameter(String name,
                                  String description,
                                  T sliderMin,
                                  T sliderMax)
Constructs a new abstract limitable parameter.

Parameters:
name - the name of the parameter.
description - the description of the parameter.
sliderMin - The parameter's slider minimum.
sliderMax - The parameter's slider maximum.

AbstractLimitableParameter

public AbstractLimitableParameter(String name,
                                  String description,
                                  T sliderMin,
                                  T sliderMax,
                                  T min,
                                  T max)
Constructs a new abstract limitable parameter.

Parameters:
name - the name of the parameter.
description - the description of the parameter.
sliderMin - The parameter's slider minimum.
sliderMax - The parameter's slider maximum.
min - The parameter's minimum.
max - The parameter's maximum.

AbstractLimitableParameter

public AbstractLimitableParameter(T value,
                                  String name,
                                  String description,
                                  T sliderMin,
                                  T sliderMax)
Constructs a new abstract limitable parameter.

Parameters:
value - the value of the parameter.
name - the name of the parameter.
description - the description of the parameter.
sliderMin - The parameter's slider minimum.
sliderMax - The parameter's slider maximum.

AbstractLimitableParameter

public AbstractLimitableParameter(T value,
                                  String name,
                                  String description,
                                  T sliderMin,
                                  T sliderMax,
                                  T min,
                                  T max)
Constructs a new abstract limitable parameter.

Parameters:
value - the value of the parameter.
name - the name of the parameter.
description - the description of the parameter.
sliderMin - The parameter's slider minimum.
sliderMax - The parameter's slider maximum.
min - The parameter's minimum.
max - The parameter's maximum.
Method Detail

getMax

public T getMax()
Returns the maximum of the intervall.

Specified by:
getMax in interface LimitableParameter<T extends Comparable<T>>
Returns:
the maximum of the intervall.

getMin

public T getMin()
Returns the minimum of the intervall.

Specified by:
getMin in interface LimitableParameter<T extends Comparable<T>>
Returns:
the minimum of the intervall.

getSliderMax

public T getSliderMax()
Returns the maximum of the intervall.

Specified by:
getSliderMax in interface LimitableParameter<T extends Comparable<T>>
Returns:
the maximum of the intervall.

getSliderMin

public T getSliderMin()
Returns the minimum of the intervall.

Specified by:
getSliderMin in interface LimitableParameter<T extends Comparable<T>>
Returns:
the minimum of the intervall.

isValid

public boolean isValid()
Returns true if the value is between the minimum and the maximum, false otherwise.

Specified by:
isValid in interface LimitableParameter<T extends Comparable<T>>
Returns:
true if the value is between the minimum and the maximum, false otherwise.

toXMLString

public String toXMLString()
Description copied from interface: Displayable
Returns a well-formed XML string representing the Displayable. The Displayable should be reconstructable via this representation. Therefore it must at least include the type of Displayable (classname) and a representation of its value. PROBABLE FUTURE DESIGN: The Displayables themselves will provide a method to reconstruct their value from the XML representation they provided.

Specified by:
toXMLString in interface Displayable<T extends Comparable<T>>
Overrides:
toXMLString in class AbstractSingleParameter<T extends Comparable<T>>
Returns:
string holding an XML representation of this Displayable
See Also:
Displayable.toXMLString()


Generated at 2012-05-30 11:00:36 PM CEST