T - public class Atomic<T extends java.io.Serializable>
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
cas(T expected,
T newValue)
This method implements compare-and-swap
|
boolean |
equals(java.lang.Object o) |
T |
get()
This method returns current value
|
int |
hashCode() |
void |
set(T value)
This method assigns new value
|
public Atomic(T initialValue)
public void set(T value)
value - public T get()
public boolean cas(T expected, T newValue)
expected - newValue - public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2019. All rights reserved.