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, tryLock
assertCloseable, 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, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAtomicValue, close, getVolatileValue, getVolatileValue, isClosed, setMaxValue, setMinValue, setOrderedValue, setVolatileValue
public 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.IllegalStateException
- if an invalid state is encountered.public void bytesStore(@NotNull @NotNull BytesStore bytes, long offset, long length) throws IllegalArgumentException, IllegalStateException, BufferOverflowException
bytesStore
in interface Byteable
bytesStore
in class AbstractReference
bytes
- 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.IllegalStateException
- if an invalid state is encountered.BufferOverflowException
- if there's not enough space in the buffer to write the reference.public long getValue() throws IllegalStateException
getValue
in interface net.openhft.chronicle.core.values.LongValue
IllegalStateException
- if the operation fails.public void setValue(long value) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.LongValue
value
- the value to be set.IllegalStateException
- if the operation fails.public long maxSize()
Byteable
@NotNull public @NotNull String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
public long addValue(long delta) throws IllegalStateException
addValue
in interface net.openhft.chronicle.core.values.LongValue
IllegalStateException
public boolean compareAndSwapValue(long expected, long value) throws IllegalStateException
compareAndSwapValue
in interface net.openhft.chronicle.core.values.LongValue
expected
- the expected value.value
- the new value.true
if successful, false
otherwise.IllegalStateException
- if the operation fails.Copyright © 2023. All rights reserved.