public class TextBooleanReference extends AbstractReference implements net.openhft.chronicle.core.values.BooleanValue
The boolean values ' true' and 'false' are represented internally as
32-bit integers in a specific format. The class also provides methods for
writing the boolean values into BytesStore
objects.
bytesStore, offset
Constructor and Description |
---|
TextBooleanReference() |
Modifier and Type | Method and Description |
---|---|
boolean |
getValue()
Get the current value of this reference.
|
long |
maxSize()
Returns the maximum size of the text representation of the boolean value in bytes.
|
void |
setValue(boolean value)
Set the value of this reference.
|
@NotNull String |
toString()
Returns a string representation of this TextBooleanReference object,
displaying the value it represents.
|
static void |
write(boolean value,
BytesStore<?,?> bytes,
long offset)
Writes a boolean value to the specified
BytesStore at the given offset
in text wire format. |
acceptNewBytesStore, address, bytesStore, 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
close, closeQuietly, closeQuietly
public static void write(boolean value, BytesStore<?,?> bytes, long offset) throws IllegalStateException, BufferOverflowException
BytesStore
at the given offset
in text wire format.value
- the boolean value to write.bytes
- the BytesStore to write to.offset
- the offset at which to write the value.BufferOverflowException
- If there's not enough space in the buffer to write the value.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 long maxSize()
@NotNull public @NotNull String toString()
toString
in class net.openhft.chronicle.core.io.AbstractCloseable
public boolean getValue() throws IllegalStateException, BufferUnderflowException
getValue
in interface net.openhft.chronicle.core.values.BooleanValue
BufferUnderflowException
- If the underlying bytes store cannot provide enough data.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(boolean value) throws IllegalStateException
setValue
in interface net.openhft.chronicle.core.values.BooleanValue
value
- the new value.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
Copyright © 2024. All rights reserved.