public class TextLongArrayReference extends AbstractReference implements ByteableLongArrayValues
The format of the text representation is:
{ capacity: 12345678901234567890, used: 00000000000000000000, values: [ 12345678901234567890, ... ] }
bytesStore, offset| Constructor and Description |
|---|
TextLongArrayReference() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindValueAt(long index,
net.openhft.chronicle.core.values.LongValue value)
Binds an external
LongValue to a specific index in this array. |
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
ByteableLongArrayValues |
capacity(long arrayLength)
Sets the capacity of the array, in terms of the number of long integers it can hold.
|
boolean |
compareAndSet(long index,
long expected,
long value) |
long |
getCapacity() |
long |
getUsed()
Get the number of elements that have been set in the array.
|
long |
getValueAt(long index) |
long |
getVolatileValueAt(long index) |
boolean |
isNull() |
long |
maxSize()
Returns the maximum size in bytes that this reference can point to.
|
static long |
peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Estimates the length of the text wire format structure for the long array
based on the current state of the given
BytesStore. |
void |
reset() |
void |
setMaxUsed(long usedAtLeast) |
void |
setOrderedValueAt(long index,
long value) |
void |
setUsed(long used) |
void |
setValueAt(long index,
long 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 the TextLongArrayReference, for debugging purposes.
|
static void |
write(@NotNull Bytes<?> bytes,
long capacity)
Writes the initial structure of a long array to the specified
Bytes instance
in text wire format, with the given capacity. |
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 IllegalArgumentException,
IllegalStateException,
BufferOverflowException,
ArithmeticException,
BufferUnderflowException
Bytes instance
in text wire format, with the given capacity.bytes - the Bytes instance to write to.capacity - the capacity of the long array to be written.IllegalArgumentException - If an illegal argument is provided.BufferOverflowException - If there's not enough space in the buffer to write the array.ArithmeticException - If numeric overflow occurs.BufferUnderflowException - If there's not enough data available to read.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,
BufferUnderflowException
BytesStore.bytes - the BytesStore containing the structure.offset - the position in bytes where the structure starts.BufferUnderflowException - If there's not enough data available to read.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.LongArrayValuesnet.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 setUsed(long used)
throws IllegalStateException
setUsed in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic void setMaxUsed(long usedAtLeast)
throws IllegalStateException
setMaxUsed in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic long getCapacity()
getCapacity in interface net.openhft.chronicle.core.values.LongArrayValuespublic ByteableLongArrayValues capacity(long arrayLength)
ByteableLongArrayValuescapacity in interface ByteableLongArrayValuesarrayLength - the desired array capacity, in number of long integers.ByteableLongArrayValues instance.public long getValueAt(long index)
throws IllegalStateException
getValueAt in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic void setValueAt(long index,
long value)
throws IllegalStateException
setValueAt in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic void bindValueAt(long index,
net.openhft.chronicle.core.values.LongValue value)
LongValue to a specific index in this array.bindValueAt in interface net.openhft.chronicle.core.values.LongArrayValuesindex - The index at which the value should be bound.value - The LongValue to be bound.UnsupportedOperationException - as this operation is not supported.public long getVolatileValueAt(long index)
throws IllegalStateException
getVolatileValueAt in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic void setOrderedValueAt(long index,
long value)
throws IllegalStateException
setOrderedValueAt in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic boolean compareAndSet(long index,
long expected,
long value)
throws IllegalStateException
compareAndSet in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic void bytesStore(@NotNull
@NotNull BytesStore bytes,
long offset,
long length)
throws IllegalStateException,
BufferOverflowException,
IllegalArgumentException
AbstractReferencebytesStore in interface ByteablebytesStore in class AbstractReferencebytes - 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 wayBufferOverflowException - If the provided buffer is too smallIllegalArgumentException - If the arguments are invalidIllegalStateExceptionpublic boolean isNull()
isNull in interface net.openhft.chronicle.core.values.LongArrayValuespublic void reset()
throws IllegalStateException
reset in interface net.openhft.chronicle.core.values.LongArrayValuesIllegalStateExceptionpublic long maxSize()
Byteable@NotNull public @NotNull String toString()
toString in class net.openhft.chronicle.core.io.AbstractCloseablepublic long sizeInBytes(long capacity)
sizeInBytes in interface ByteableLongArrayValuessizeInBytes in interface net.openhft.chronicle.core.values.LongArrayValuescapacity - The capacity of the array.Copyright © 2024. All rights reserved.