Package io.deephaven.chunk
Class WritableBooleanChunk<ATTR extends Any>
java.lang.Object
io.deephaven.chunk.ChunkBase<ATTR>
io.deephaven.chunk.BooleanChunk<ATTR>
io.deephaven.chunk.WritableBooleanChunk<ATTR>
- All Implemented Interfaces:
Chunk<ATTR>
,PoolableChunk
,WritableChunk<ATTR>
,SafeCloseable
,AutoCloseable
- Direct Known Subclasses:
ResettableWritableBooleanChunk
public class WritableBooleanChunk<ATTR extends Any>
extends BooleanChunk<ATTR>
implements WritableChunk<ATTR>
WritableChunk
implementation for boolean data.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.chunk.Chunk
Chunk.Visitor<ATTR extends Any>
-
Field Summary
Fields inherited from interface io.deephaven.chunk.Chunk
MAXIMUM_SIZE, SYSTEM_ARRAYCOPY_THRESHOLD, SYSTEM_ARRAYFILL_THRESHOLD
-
Constructor Summary
ModifierConstructorDescriptionprotected
WritableBooleanChunk
(boolean[] data, int offset, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(boolean value) final void
appendTypedChunk
(BooleanChunk<? extends ATTR> src, int srcOffset, int length) final boolean[]
array()
Get the data array backing this WritableBooleanChunk.final int
Get this WritableBooleanChunk's offset into the backing data array.void
close()
final void
copyFromArray
(Object srcArray, int srcOffset, int destOffset, int length) final void
copyFromChunk
(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length) final void
copyFromTypedArray
(boolean[] src, int srcOffset, int destOffset, int length) final void
copyFromTypedChunk
(BooleanChunk<? extends ATTR> src, int srcOffset, int destOffset, int length) final void
fillWithBoxedValue
(int offset, int size, Object value) Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.final void
fillWithValue
(int offset, int length, boolean value) static <ATTR extends Any>
WritableBooleanChunk<ATTR>makeWritableChunk
(int size) static <ATTR extends Any>
WritableBooleanChunk<ATTR>makeWritableChunkForPool
(int size) final void
set
(int index, boolean value) slice
(int offset, int capacity) Make a new Chunk that represents either exactly the same view on the underlying data as this Chunk, or a subrange of that view.final void
sort()
Sort this chunk in-place using Java's primitive defined ordering.static <ATTR extends Any,
ATTR_DERIV extends ATTR>
WritableBooleanChunk<ATTR>upcast
(WritableBooleanChunk<ATTR_DERIV> self) static <ATTR extends Any>
WritableBooleanChunk<ATTR>writableChunkWrap
(boolean[] data) static <ATTR extends Any>
WritableBooleanChunk<ATTR>writableChunkWrap
(boolean[] data, int offset, int size) Methods inherited from class io.deephaven.chunk.BooleanChunk
chunkWrap, chunkWrap, copyToArray, copyToChunk, copyToTypedArray, downcast, get, getChunkType, getEmptyChunk, isAlias, isAlias, makeArray, walk
Methods inherited from class io.deephaven.chunk.ChunkBase
internalCapacity, internalSetSize, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.chunk.Chunk
asBooleanChunk, asByteChunk, asCharChunk, asDoubleChunk, asFloatChunk, asIntChunk, asLongChunk, asObjectChunk, asShortChunk, checkChunkType, copyToArray, copyToBuffer, copyToChunk, getChunkType, isAlias, isAlias, size, walk
Methods inherited from interface io.deephaven.chunk.WritableChunk
asWritableBooleanChunk, asWritableByteChunk, asWritableCharChunk, asWritableDoubleChunk, asWritableFloatChunk, asWritableIntChunk, asWritableLongChunk, asWritableObjectChunk, asWritableShortChunk, capacity, copyFromBuffer, fillWithNullValue, internalCapacity, internalSetSize, setSize, sort
-
Constructor Details
-
WritableBooleanChunk
protected WritableBooleanChunk(boolean[] data, int offset, int capacity)
-
-
Method Details
-
makeWritableChunk
-
makeWritableChunkForPool
-
writableChunkWrap
-
writableChunkWrap
public static <ATTR extends Any> WritableBooleanChunk<ATTR> writableChunkWrap(boolean[] data, int offset, int size) -
set
public final void set(int index, boolean value) -
add
public final void add(boolean value) -
slice
Description copied from interface:Chunk
Make a new Chunk that represents either exactly the same view on the underlying data as this Chunk, or a subrange of that view. The view is defined as [0..size) (in the coordinate space of this Chunk).- Specified by:
slice
in interfaceChunk<ATTR extends Any>
- Specified by:
slice
in interfaceWritableChunk<ATTR extends Any>
- Overrides:
slice
in classBooleanChunk<ATTR extends Any>
- Parameters:
offset
- Offset of the new Chunk, relative to this Chunk. 0 ≤ offset ≤ this.sizecapacity
- Capacity and initial size of the new Chunk. 0 ≤ capacity ≤ this.size -offset
.- Returns:
- The new Chunk. A new Chunk will always be returned, even if the Chunks represent the same view.
-
array
public final boolean[] array()Get the data array backing this WritableBooleanChunk. The first element of this chunk corresponds toarray()[arrayOffset()]
.This WritableBooleanChunk must never be
closed
while the array may be in use externally, because it must not be returned to any pool for re-use until that re-use is guaranteed to be exclusive.- Returns:
- The backing data array
-
arrayOffset
public final int arrayOffset()Get this WritableBooleanChunk's offset into the backing data array. The first element of this chunk corresponds toarray()[arrayOffset()]
.- Returns:
- The offset into the backing data array
-
fillWithBoxedValue
Description copied from interface:WritableChunk
Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.- Specified by:
fillWithBoxedValue
in interfaceWritableChunk<ATTR extends Any>
- Parameters:
offset
- Starting offsetsize
- Number of values to fill
-
fillWithValue
public final void fillWithValue(int offset, int length, boolean value) -
appendTypedChunk
-
copyFromChunk
public final void copyFromChunk(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length) - Specified by:
copyFromChunk
in interfaceWritableChunk<ATTR extends Any>
-
copyFromTypedChunk
public final void copyFromTypedChunk(BooleanChunk<? extends ATTR> src, int srcOffset, int destOffset, int length) -
copyFromArray
- Specified by:
copyFromArray
in interfaceWritableChunk<ATTR extends Any>
-
copyFromTypedArray
public final void copyFromTypedArray(boolean[] src, int srcOffset, int destOffset, int length) -
sort
public final void sort()Description copied from interface:WritableChunk
Sort this chunk in-place using Java's primitive defined ordering.Of note is that nulls or NaNs are not sorted according to Deephaven ordering rules.
- Specified by:
sort
in interfaceWritableChunk<ATTR extends Any>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
upcast
public static <ATTR extends Any,ATTR_DERIV extends ATTR> WritableBooleanChunk<ATTR> upcast(WritableBooleanChunk<ATTR_DERIV> self)
-