public class TextLongReference extends AbstractReference implements LongReference
!!atomic { locked: false, value: 00000000000000000000 } .bytes, offset| Constructor and Description |
|---|
TextLongReference() |
| Modifier and Type | Method and Description |
|---|---|
long |
addValue(long delta) |
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Configures the byte store for this reference.
|
boolean |
compareAndSwapValue(long expected,
long value)
Atomically sets the value to the given updated value if the current value is
equal to the expected value.
|
long |
getValue()
Retrieves the value from the Text wire format.
|
long |
maxSize()
Returns the maximum size in bytes that this reference can point to.
|
void |
setValue(long value)
Sets the value in the Text wire format.
|
@NotNull String |
toString() |
static void |
write(@NotNull Bytes<?> bytes,
long value)
Writes the initial structure of a 64-bit long value to the specified
Bytes instance
in Text wire format, with the given value. |
acceptNewBytesStore, address, bytesStore, lock, offset, performClose, tryLockassertCloseable, assertCloseablesClosed, clearUsedByThread, close, createdHere, disableCloseableTracing, disableThreadSafetyCheck, disableThreadSafetyCheck, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, resetUsedByThread, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAtomicValue, close, getVolatileValue, getVolatileValue, isClosed, setMaxValue, setMinValue, setOrderedValue, setVolatileValuepublic static void write(@NotNull
@NotNull Bytes<?> bytes,
long value)
throws BufferOverflowException,
IllegalArgumentException,
IllegalStateException
Bytes instance
in Text wire format, with the given value.bytes - the Bytes instance to write to.value - the long value to be written.BufferOverflowException - If there's not enough space in the buffer to write the value.IllegalArgumentException - If an illegal argument is provided.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionpublic void bytesStore(@NotNull
@NotNull BytesStore bytes,
long offset,
long length)
throws IllegalArgumentException,
IllegalStateException,
BufferOverflowException
bytesStore in interface ByteablebytesStore in class AbstractReferencebytes - the BytesStore instance where the reference is to be stored.offset - the offset in the byte store where the reference is to be positioned.length - the length of the reference in bytes.IllegalArgumentException - If an illegal argument is provided.BufferOverflowException - If there's not enough space in the buffer to write the reference.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionpublic long getValue()
throws IllegalStateException
getValue in interface net.openhft.chronicle.core.values.LongValuenet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionpublic void setValue(long value)
throws IllegalStateException
setValue in interface net.openhft.chronicle.core.values.LongValuevalue - the value to be set.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionpublic long maxSize()
Byteable@NotNull public @NotNull String toString()
toString in class net.openhft.chronicle.core.io.AbstractCloseablepublic long addValue(long delta)
throws IllegalStateException
addValue in interface net.openhft.chronicle.core.values.LongValueIllegalStateExceptionpublic boolean compareAndSwapValue(long expected,
long value)
throws IllegalStateException
compareAndSwapValue in interface net.openhft.chronicle.core.values.LongValueexpected - the expected value.value - the new value.true if successful, false otherwise.net.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionCopyright © 2023. All rights reserved.