Interface UnixFSAtomicLong
public interface UnixFSAtomicLong
Interface which behaves similar to an
AtomicLong, but with reduced functionality. This may be a pure memory
based implementation, as backed by AtomicLong, or it may be backed by one obtained from
UnixFSMemoryUtils.getAtomicLong(ByteBuffer)-
Method Summary
Modifier and TypeMethodDescriptionstatic UnixFSAtomicLongbasic()Creates a basicUnixFSAtomicLong.booleancompareAndSet(long expect, long update) Compares and sets the value, atomically.longget()Gets the current value, atomically.default voidset(long value) Sets the value of, atomically.static UnixFSAtomicLongwrap(AtomicLong atomicLong) Wraps an instance ofAtomicLonginto an instance ofUnixFSAtomicLong.
-
Method Details
-
get
long get()Gets the current value, atomically.- Returns:
- the value
-
set
default void set(long value) Sets the value of, atomically.- Parameters:
value- the value to set
-
compareAndSet
boolean compareAndSet(long expect, long update) Compares and sets the value, atomically.- Parameters:
expect- the expected valueupdate- the new value to update- Returns:
- true if set, false otherwise
-
basic
Creates a basicUnixFSAtomicLong.- Returns:
- a
UnixFSAtomicLonginstance
-
wrap
Wraps an instance ofAtomicLonginto an instance ofUnixFSAtomicLong.- Returns:
- a
UnixFSAtomicLonginstance
-