org.multiverse.transactional.refs
Class DoubleRef

java.lang.Object
  extended by org.multiverse.transactional.refs.DoubleRef

public class DoubleRef
extends Object

A Ref for storing a double.

Author:
Peter Veentjer.

Constructor Summary
DoubleRef()
           
DoubleRef(double value)
           
 
Method Summary
 void await(double desired)
           
 double dec()
          Decreases the value by one.
 double dec(double amount)
          Decreases the value with the given amount.
 boolean equals(Object thatobj)
           
 double get()
           
 int hashCode()
           
 double inc()
          Increases the current value by one.
 double inc(double amount)
          Increases the value with the given amount.
 double set(double newValue)
          Sets the new value and returns the old value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleRef

public DoubleRef()

DoubleRef

public DoubleRef(double value)
Method Detail

get

public final double get()

await

public final void await(double desired)

set

public final double set(double newValue)
Sets the new value and returns the old value.

Parameters:
newValue - the new value.
Returns:
the previous value.

inc

public final double inc()
Increases the current value by one.

Returns:
the new value.

inc

public final double inc(double amount)
Increases the value with the given amount.

Parameters:
amount - the amount to increase with.
Returns:
the new value

dec

public final double dec()
Decreases the value by one.

Returns:
the new value.

dec

public final double dec(double amount)
Decreases the value with the given amount.

Parameters:
amount - the amount to decrease with.
Returns:
the new value.

toString

public final String toString()
Overrides:
toString in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object thatobj)
Overrides:
equals in class Object


Copyright © 2008-2010 Multiverse. All Rights Reserved.