|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
edu.mit.jmwe.util.AtomicDouble<T,S>
public class AtomicDouble<T,S>
A double value that may be updated atomically. See the
java.util.concurrent.atomic
package specification for
description of the properties of atomic variables. An
AtomicDouble is used in applications such as atomically
incremented counters, and cannot be used as a replacement for an
Integer
. However, this class does extend
Number to allow uniform access by tools and utilities that
deal with numerically-based classes.
Constructor Summary | |
---|---|
AtomicDouble()
Create a new AtomicDouble with initial value 0. |
|
AtomicDouble(double initialValue)
Create a new AtomicInteger with the given initial value. |
Method Summary | |
---|---|
double |
doubleValue()
|
float |
floatValue()
|
double |
get()
Get the current value. |
void |
increment(double amt)
Increments the current value by the specified amount. |
int |
intValue()
|
long |
longValue()
|
void |
set(double newValue)
Set to the given value. |
String |
toString()
|
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AtomicDouble()
public AtomicDouble(double initialValue)
initialValue
- the initial valueMethod Detail |
---|
public final double get()
public final void set(double newValue)
newValue
- the new valuepublic void increment(double amt)
public String toString()
toString
in class Object
public int intValue()
intValue
in class Number
public long longValue()
longValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |