public class AtomicDouble<T,S>
extends java.lang.Number
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 and Description |
---|
AtomicDouble()
Create a new AtomicDouble with initial value 0.
|
AtomicDouble(double initialValue)
Create a new AtomicInteger with the given initial value.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
toString() |
public AtomicDouble()
public AtomicDouble(double initialValue)
initialValue
- the initial valuepublic final double get()
public final void set(double newValue)
newValue
- the new valuepublic void increment(double amt)
amt
- the amount by which to increment the doublepublic java.lang.String toString()
toString
in class java.lang.Object
public int intValue()
intValue
in class java.lang.Number
public long longValue()
longValue
in class java.lang.Number
public float floatValue()
floatValue
in class java.lang.Number
public double doubleValue()
doubleValue
in class java.lang.Number
Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.