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
bytesStore, 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, unmonitor
assertCloseable, assertCloseablesClosed, close, createdHere, disableCloseableTracing, enableCloseableTracing, gcAndWaitForCloseablesToClose, isClosed, isClosing, isInUserThread, referenceId, shouldPerformCloseInBackground, shouldWaitForClosed, singleThreadedCheckDisabled, singleThreadedCheckDisabled, singleThreadedCheckReset, threadSafetyCheck, throwExceptionIfClosed, throwExceptionIfClosedInSetter, toString, unmonitor, waitForCloseablesToClose, waitForClosed, warnAndCloseIfNotClosed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, closeQuietly, closeQuietly
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 setIllegalArgumentException
- If the arguments are invalidBufferOverflowException
- If the provided buffer is too smallnet.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()
public boolean getValue() throws IllegalStateException, BufferUnderflowException
getValue
in interface net.openhft.chronicle.core.values.BooleanValue
BufferUnderflowException
- If the bytes store contains insufficient datanet.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(boolean flag) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.BooleanValue
flag
- The boolean value to writenet.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.