DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class RangedValue

java.lang.Object
  extended by com.cosylab.gui.components.range2.RangedValue
All Implemented Interfaces:
java.io.Serializable

public final class RangedValue
extends java.lang.Object
implements java.io.Serializable

This class stores values representing RangedValue. No checks are made for validity of the values. Only purpose of this class is to provide data transfer between RangedValue and RangedValuePolicy. As such, this class will normaly be used only internaly by RangedValue.

Version:
$id$
Author:
Ales Pucelj
See Also:
Serialized Form

Constructor Summary
RangedValue()
           
RangedValue(double minimum, double maximum, double value)
           
 
Method Summary
 RangedValue deriveWithMax(double maximum)
          Returns a new RangedValue with min and value the same as this object, but with the given maximum.
 RangedValue deriveWithMin(double minimum)
          Returns a new RangedValue with max and value the same as this object, but with the given minimum.
 RangedValue deriveWithValue(double value)
          Returns a new RangedValue with min/max the same as this object, but with the given value.
 double getMaximum()
          Returns the maximum.
 double getMinimum()
          Returns the minimum.
 double getValue()
          Returns the value.
 boolean isValid()
          Check if the value is valid within bounds.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangedValue

public RangedValue()

RangedValue

public RangedValue(double minimum,
                   double maximum,
                   double value)
Parameters:
minimum - double
maximum - double
value - double
Method Detail

getMinimum

public final double getMinimum()
Returns the minimum.

Returns:
minimum

getMaximum

public final double getMaximum()
Returns the maximum.

Returns:
maximum

getValue

public final double getValue()
Returns the value.

Returns:
value

isValid

public final boolean isValid()
Check if the value is valid within bounds.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

deriveWithValue

public RangedValue deriveWithValue(double value)
Returns a new RangedValue with min/max the same as this object, but with the given value.

Parameters:
value - new value for the RangedValue
Returns:
new RangedValue

deriveWithMax

public RangedValue deriveWithMax(double maximum)
Returns a new RangedValue with min and value the same as this object, but with the given maximum.

Parameters:
maximum - new maximum for the RangedValue
Returns:
new RangedValue

deriveWithMin

public RangedValue deriveWithMin(double minimum)
Returns a new RangedValue with max and value the same as this object, but with the given minimum.

Parameters:
value - new minimum for the RangedValue
Returns:
new RangedValue


Copyright © 2010. All Rights Reserved.