mark.core.util
Class DoubleWrap

java.lang.Object
  |
  +--mark.core.util.DoubleWrap

public class DoubleWrap
extends java.lang.Object

My own wrapper for a double. Unlike java.lang.Double, you may modify the value of this wrapper. I also provide Comparators to sort in ascending or descending order.


Field Summary
protected static java.util.Comparator fNormal
           
protected  double fNum
           
protected static java.util.Comparator fReverse
           
 
Constructor Summary
DoubleWrap()
          Initializes the wrapper with zero.
DoubleWrap(double num)
          Initializes the wrapper with the given double.
 
Method Summary
static java.util.Comparator getNormal()
           
static java.util.Comparator getReverse()
           
 double num()
          Returns the value of the wrapper.
 void setNum(double num)
          Sets the value of the wrapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fReverse

protected static java.util.Comparator fReverse

fNormal

protected static java.util.Comparator fNormal

fNum

protected double fNum
Constructor Detail

DoubleWrap

public DoubleWrap(double num)
Initializes the wrapper with the given double.

Parameters:
num - the initial value.

DoubleWrap

public DoubleWrap()
Initializes the wrapper with zero.

Method Detail

getReverse

public static java.util.Comparator getReverse()

getNormal

public static java.util.Comparator getNormal()

num

public double num()
Returns the value of the wrapper.

Returns:
the value of the wrapper.

setNum

public void setNum(double num)
Sets the value of the wrapper.

Parameters:
num - the value.