T - public class Atomic<T extends Serializable> extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
cas(T expected,
T newValue)
This method implements compare-and-swap
|
boolean |
equals(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 - Copyright © 2022. All rights reserved.