public static final class Atomic.Var<E>
extends java.lang.Object
""| Modifier and Type | Field and Description |
|---|---|
protected Engine |
engine |
protected long |
recid |
protected Serializer<E> |
serializer |
| Modifier | Constructor and Description |
|---|---|
|
Var(Engine engine,
long recid,
Serializer<E> serializer) |
protected |
Var(Engine engine,
SerializerBase serializerBase,
java.io.DataInput is,
SerializerBase.FastArrayList<java.lang.Object> objectStack)
used for deserialization
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
compareAndSet(E expect,
E update)
Atomically sets the value to the given updated value
if the current value equals the expected value.
|
E |
get()
Returns the current value.
|
E |
getAndSet(E newValue)
Atomically sets to the given value and returns the previous value.
|
long |
getRecid() |
void |
set(E newValue)
Unconditionally sets to the given value.
|
java.lang.String |
toString() |
protected final Engine engine
protected final long recid
protected final Serializer<E> serializer
public Var(Engine engine, long recid, Serializer<E> serializer)
protected Var(Engine engine, SerializerBase serializerBase, java.io.DataInput is, SerializerBase.FastArrayList<java.lang.Object> objectStack) throws java.io.IOException
java.io.IOExceptionpublic long getRecid()
public java.lang.String toString()
toString in class java.lang.Objectpublic final E get()
public final boolean compareAndSet(E expect, E update)
expect - the expected valueupdate - the new valuepublic final void set(E newValue)
newValue - the new value