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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an UnixFSAtomicLong which maps to the supplied ByteBuffer's position returned by Struct.getByteBufferPosition().
    void
    initialize(long value)
    Initializes the atomic long data to the supplied value.
    final boolean
     
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 class javolution.io.Struct
    • createAtomicLong

      public UnixFSAtomicLong createAtomicLong()
      Returns an UnixFSAtomicLong which maps to the supplied ByteBuffer's position returned by Struct.getByteBufferPosition(). Note that the returned UnixFSAtomicLong is permanently bound to the current ByteBuffer. If a call to Struct.setByteBuffer(ByteBuffer, int) is made, then a new atomic long will need to be set.
      Returns:
      the UnixFSAtomicLong instance
    • toString

      public String toString()
      Overrides:
      toString in class javolution.io.Struct