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 UnixFSAtomicLong
basic()
Creates a basicUnixFSAtomicLong
.boolean
compareAndSet
(long expect, long update) Compares and sets the value, atomically.long
get()
Gets the current value, atomically.default void
set
(long value) Sets the value of, atomically.static UnixFSAtomicLong
wrap
(AtomicLong atomicLong) Wraps an instance ofAtomicLong
into 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
UnixFSAtomicLong
instance
-
wrap
Wraps an instance ofAtomicLong
into an instance ofUnixFSAtomicLong
.- Returns:
- a
UnixFSAtomicLong
instance
-