public class TextIntArrayReference extends AbstractReference implements ByteableIntArrayValues
The bytes encode capacity, used and zero-padded values.
Locking relies on the locked flag in each entry.
Magic constants such as FALSE and TRUE hold the
lock state.
Debugging aid; not for high performance operations.
bytesStore, offset| Constructor and Description |
|---|
TextIntArrayReference() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindValueAt(long index,
net.openhft.chronicle.core.values.IntValue value) |
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying
BytesStore together with the offset and length. |
ByteableIntArrayValues |
capacity(long arrayLength)
Sets the capacity of the array as a count of elements, not bytes.
|
boolean |
compareAndSet(long index,
int expected,
int value) |
long |
getCapacity() |
long |
getUsed() |
int |
getValueAt(long index) |
int |
getVolatileValueAt(long index) |
boolean |
isNull() |
long |
maxSize() |
static long |
peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Determines the length of the array in the text format represented in the given
BytesStore. |
void |
reset() |
void |
setMaxUsed(long usedAtLeast) |
void |
setOrderedValueAt(long index,
int value) |
void |
setValueAt(long index,
int value) |
long |
sizeInBytes(long capacity)
Calculates the size in bytes needed for storing an array with the specified capacity.
|
@NotNull String |
toString()
Returns a String representation of this TextIntArrayReference.
|
static void |
write(@NotNull Bytes<?> bytes,
long capacity)
Writes an array of integers to the specified
Bytes instance in a text format. |
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, waitclose, closeQuietly, closeQuietlyaddress, bytesStore, lock, offset, tryLockpublic static void write(@NotNull
@NotNull Bytes<?> bytes,
long capacity)
throws IllegalStateException,
BufferOverflowException
Bytes instance in a text format.bytes - the Bytes instance to write to.capacity - the capacity of the array to be written.BufferOverflowException - If there's not enough space in the buffer to write the array.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 static long peakLength(@NotNull
@NotNull BytesStore<?,?> bytes,
long offset)
throws IllegalStateException
BytesStore.bytes - the BytesStore containing the text representation.offset - the offset at which the text representation starts.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 getUsed()
throws IllegalStateException
getUsed in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic void setMaxUsed(long usedAtLeast)
throws IllegalStateException
setMaxUsed in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic long getCapacity()
getCapacity in interface net.openhft.chronicle.core.values.IntArrayValuespublic ByteableIntArrayValues capacity(long arrayLength)
ByteableIntArrayValuescapacity in interface ByteableIntArrayValuesarrayLength - the desired element countpublic int getValueAt(long index)
throws IllegalStateException
getValueAt in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic void setValueAt(long index,
int value)
throws IllegalStateException
setValueAt in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic void bindValueAt(long index,
net.openhft.chronicle.core.values.IntValue value)
bindValueAt in interface net.openhft.chronicle.core.values.IntArrayValuespublic int getVolatileValueAt(long index)
throws IllegalStateException
getVolatileValueAt in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic void setOrderedValueAt(long index,
int value)
throws IllegalStateException
setOrderedValueAt in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic boolean compareAndSet(long index,
int expected,
int value)
throws IllegalStateException
compareAndSet in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic void bytesStore(@NotNull
@NotNull BytesStore bytes,
long offset,
long length)
throws IllegalStateException,
IllegalArgumentException,
BufferOverflowException
AbstractReferenceBytesStore together with the offset and length.bytesStore in interface ByteablebytesStore in class AbstractReferencebytes - the BytesStore providing the backing memoryoffset - the non-negative offset within the storelength - the number of bytes this reference spansnet.openhft.chronicle.core.io.ClosedIllegalStateException - if the store is closednet.openhft.chronicle.core.io.ThreadingIllegalStateException - if accessed from the wrong threadIllegalArgumentException - if length does not match Byteable.maxSize()BufferOverflowException - if the region exceeds the store capacityIllegalStateExceptionpublic boolean isNull()
isNull in interface net.openhft.chronicle.core.values.IntArrayValuespublic void reset()
throws IllegalStateException
reset in interface net.openhft.chronicle.core.values.IntArrayValuesIllegalStateExceptionpublic long maxSize()
@NotNull public @NotNull String toString()
toString in class net.openhft.chronicle.core.io.AbstractCloseablepublic long sizeInBytes(long capacity)
sizeInBytes in interface ByteableIntArrayValuessizeInBytes in interface net.openhft.chronicle.core.values.IntArrayValuescapacity - The capacity of the array.Copyright © 2026 Chronicle Software Ltd. All rights reserved.