public static final class Atomic.Var<E>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
recid |
protected Serializer<E> |
serializer |
protected org.mapdb.Store |
store |
| Constructor and Description |
|---|
Var(org.mapdb.Store store,
long recid,
Serializer<E> serializer) |
| 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 org.mapdb.Store store
protected final long recid
protected final Serializer<E> serializer
public Var(org.mapdb.Store store,
long recid,
Serializer<E> serializer)
public 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 valueCopyright © 2018. All Rights Reserved.