public class TextLongReference extends AbstractReference implements LongReference
The layout is exactly 34 bytes and includes a spin-lock
flag. The lock is obtained via CAS in withLock(ThrowingLongSupplier).
FALSE and TRUE encode the lock state as four ASCII
characters.
These text classes are intended for debugging rather than production use.
bytesStore, 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() |
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, tryLock, unmonitorassertCloseable, assertCloseablesClosed, close, createdHere, disableCloseableTracing, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAtomicValue, close, getVolatileValue, getVolatileValue, isClosed, setMaxValue, setMinValue, setOrderedValue, setVolatileValueaddress, bytesStore, lock, offset, tryLockpublic 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()
@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 © 2026 Chronicle Software Ltd. All rights reserved.