kiwi.util
Class DoubleHolder

java.lang.Object
  extended bykiwi.util.HolderObject
      extended bykiwi.util.DoubleHolder

public class DoubleHolder
extends HolderObject

A mutable holder for a double value.

Author:
Mark Lindner, PING Software Group

Field Summary
protected  double value
          The current value.
 
Fields inherited from class kiwi.util.HolderObject
subtype
 
Constructor Summary
DoubleHolder()
          Construct a new DoubleHolder with an initial value of 0.0 and default subtype of 0.
DoubleHolder(double value)
          Construct a new DoubleHolder with a specified initial value and default subtype of 0.
DoubleHolder(double value, int subtype)
          Construct a new DoubleHolder with a specified initial value and subtype.
 
Method Summary
 int compareTo(HolderObject other)
          Compare this holder object to another.
 double getValue()
          Get the DoubleHolder's value.
 void setValue(double value)
          Set the DoubleHolder's value.
 java.lang.String toString()
          Get a string representation for this object.
 
Methods inherited from class kiwi.util.HolderObject
getSubtype, setSubtype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected double value
The current value.

Constructor Detail

DoubleHolder

public DoubleHolder()
Construct a new DoubleHolder with an initial value of 0.0 and default subtype of 0.


DoubleHolder

public DoubleHolder(double value)
Construct a new DoubleHolder with a specified initial value and default subtype of 0.

Parameters:
value - The initial value.

DoubleHolder

public DoubleHolder(double value,
                    int subtype)
Construct a new DoubleHolder with a specified initial value and subtype.

Parameters:
value - The initial value.
subtype - The subtype for this value.
Method Detail

setValue

public final void setValue(double value)
Set the DoubleHolder's value.

Parameters:
value - The new value.

getValue

public final double getValue()
Get the DoubleHolder's value.

Returns:
The current value.

toString

public java.lang.String toString()
Get a string representation for this object.


compareTo

public int compareTo(HolderObject other)
Compare this holder object to another.

Specified by:
compareTo in class HolderObject
Parameters:
other - The HolderObject to compare against.
Returns:
-1 if this object is "less than" the other object; 1 if this object is "greater than" the other object, and 0 if the objects are "equal."