public class TextIntReference extends AbstractReference implements net.openhft.chronicle.core.values.IntValue
The format of the text representation is:
!!atomic { locked: false, value: 0000000000 }
bytesStore, offset
Constructor and Description |
---|
TextIntReference() |
Modifier and Type | Method and Description |
---|---|
int |
addAtomicValue(int delta) |
int |
addValue(int delta) |
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
boolean |
compareAndSwapValue(int expected,
int value) |
int |
getValue()
Retrieves the 32-bit integer value from the Text wire format.
|
int |
getVolatileValue() |
long |
maxSize()
Returns the maximum size in bytes that this reference can point to.
|
void |
setOrderedValue(int value) |
void |
setValue(int value)
Sets the 32-bit integer value in the Text wire format.
|
@NotNull String |
toString()
Returns the string representation of the TextIntReference.
|
static void |
write(@NotNull Bytes<?> bytes,
int value)
Writes the provided 32-bit integer value into the given Bytes instance in Text wire format.
|
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
public static void write(@NotNull @NotNull Bytes<?> bytes, int value) throws BufferOverflowException, IllegalStateException
bytes
- the Bytes instance to write to.value
- the 32-bit integer value to be written.BufferOverflowException
- If there is insufficient space.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 int getValue() throws IllegalStateException
getValue
in interface net.openhft.chronicle.core.values.IntValue
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(int value) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.IntValue
value
- the 32-bit integer 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 int getVolatileValue() throws IllegalStateException
getVolatileValue
in interface net.openhft.chronicle.core.values.IntValue
IllegalStateException
public void setOrderedValue(int value) throws IllegalStateException
setOrderedValue
in interface net.openhft.chronicle.core.values.IntValue
IllegalStateException
public int addValue(int delta) throws IllegalStateException
addValue
in interface net.openhft.chronicle.core.values.IntValue
IllegalStateException
public int addAtomicValue(int delta) throws IllegalStateException
addAtomicValue
in interface net.openhft.chronicle.core.values.IntValue
IllegalStateException
public boolean compareAndSwapValue(int expected, int value) throws IllegalStateException
compareAndSwapValue
in interface net.openhft.chronicle.core.values.IntValue
IllegalStateException
public void bytesStore(@NotNull @NotNull BytesStore bytes, long offset, long length) throws IllegalStateException, IllegalArgumentException, BufferOverflowException
AbstractReference
bytesStore
in interface Byteable
bytesStore
in class AbstractReference
bytes
- the BytesStore to setoffset
- the offset to setlength
- the length to setnet.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 wayIllegalArgumentException
- If the arguments are invalidBufferOverflowException
- If the provided buffer is too smallIllegalStateException
public long maxSize()
Byteable
@NotNull public @NotNull String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
Copyright © 2024. All rights reserved.