Class UnixFSAtomicLongData
java.lang.Object
javolution.io.Struct
dev.getelements.elements.rt.transact.unix.UnixFSAtomicLongData
public class UnixFSAtomicLongData
extends javolution.io.Struct
Used as a means to produce an instance of
UnixFSAtomicLong
from the underlying ByteBuffer
in the struct. This ensures correct alignment provided the underlying ByteBuffer
is properly
aligned.-
Nested Class Summary
Nested classes/interfaces inherited from class javolution.io.Struct
javolution.io.Struct.BitField, javolution.io.Struct.Bool, javolution.io.Struct.Enum16<T extends Enum<T>>, javolution.io.Struct.Enum32<T extends Enum<T>>, javolution.io.Struct.Enum64<T extends Enum<T>>, javolution.io.Struct.Enum8<T extends Enum<T>>, javolution.io.Struct.Float32, javolution.io.Struct.Float64, javolution.io.Struct.Member, javolution.io.Struct.Reference32<S extends javolution.io.Struct>, javolution.io.Struct.Reference64<S extends javolution.io.Struct>, javolution.io.Struct.Signed16, javolution.io.Struct.Signed32, javolution.io.Struct.Signed64, javolution.io.Struct.Signed8, javolution.io.Struct.Unsigned16, javolution.io.Struct.Unsigned32, javolution.io.Struct.Unsigned8, javolution.io.Struct.UTF8String
-
Field Summary
Fields inherited from class javolution.io.Struct
MAXIMUM_ALIGNMENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns anUnixFSAtomicLong
which maps to the suppliedByteBuffer
's position returned byStruct.getByteBufferPosition()
.void
initialize
(long value) Initializes the atomic long data to the supplied value.final boolean
isPacked()
toString()
Methods inherited from class javolution.io.Struct
address, array, array, array, array, array, array, array, byteOrder, getByteBuffer, getByteBufferPosition, inner, isUnion, outer, read, readBits, setByteBuffer, setByteBufferPosition, size, write, writeBits
-
Constructor Details
-
UnixFSAtomicLongData
public UnixFSAtomicLongData()
-
-
Method Details
-
initialize
public void initialize(long value) Initializes the atomic long data to the supplied value. This will, non atomically, write the value to the bytes in the underlying buffer. This should only be used to initialize the value when the counter is created and should not be used again.- Parameters:
value
- the value to set
-
isPacked
public final boolean isPacked()- Overrides:
isPacked
in classjavolution.io.Struct
-
createAtomicLong
Returns anUnixFSAtomicLong
which maps to the suppliedByteBuffer
's position returned byStruct.getByteBufferPosition()
. Note that the returnedUnixFSAtomicLong
is permanently bound to the currentByteBuffer
. If a call toStruct.setByteBuffer(ByteBuffer, int)
is made, then a new atomic long will need to be set.- Returns:
- the
UnixFSAtomicLong
instance
-
toString
- Overrides:
toString
in classjavolution.io.Struct
-