public class TextLongReference extends AbstractReference implements LongReference
!!atomic { locked: false, value: 00000000000000000000 }
.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()
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, unmonitor
assertCloseable, assertCloseablesClosed, close, createdHere, disableCloseableTracing, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, 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
address, bytesStore, lock, offset, tryLock
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.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 wayIllegalStateException
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.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 wayIllegalStateException
public long getValue() throws IllegalStateException
getValue
in interface net.openhft.chronicle.core.values.LongValue
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 wayIllegalStateException
public void setValue(long value) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.LongValue
value
- 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 wayIllegalStateException
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.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 wayIllegalStateException
Copyright © 2024. All rights reserved.