public class BinaryBooleanReference extends AbstractReference implements net.openhft.chronicle.core.values.BooleanValue
This class encapsulates a reference to a boolean value stored in binary form. It provides
functionality to read and write a boolean value to/from a BytesStore
.
BytesStore
,
BooleanValue
bytes, offset
Constructor and Description |
---|
BinaryBooleanReference() |
Modifier and Type | Method and Description |
---|---|
void |
bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
boolean |
getValue()
Reads a boolean value from the bytes store.
|
long |
maxSize()
Returns the maximum size of the byte representation of a boolean value.
|
void |
setValue(boolean flag)
Writes a boolean value to the bytes store.
|
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, toString, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public void bytesStore(@NotNull @NotNull BytesStore bytes, long offset, long length) throws IllegalStateException, IllegalArgumentException, BufferOverflowException
bytesStore
in interface Byteable
bytesStore
in class AbstractReference
bytes
- the BytesStore to setoffset
- the offset to setlength
- the length to setIllegalStateException
- if the state is invalidIllegalArgumentException
- if the arguments are invalidBufferOverflowException
- if the provided buffer is too smallpublic long maxSize()
public boolean getValue() throws IllegalStateException, BufferUnderflowException
getValue
in interface net.openhft.chronicle.core.values.BooleanValue
IllegalStateException
- If an illegal condition has occurredBufferUnderflowException
- If the bytes store contains insufficient datapublic void setValue(boolean flag) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.BooleanValue
flag
- The boolean value to writeIllegalStateException
- If an illegal condition has occurredCopyright © 2023. All rights reserved.