Class WritableBooleanChunk<ATTR extends Attributes.Any>
java.lang.Object
com.illumon.iris.db.v2.sources.chunk.ChunkBase<ATTR>
com.illumon.iris.db.v2.sources.chunk.BooleanChunk<ATTR>
com.illumon.iris.db.v2.sources.chunk.WritableBooleanChunk<ATTR>
- All Implemented Interfaces:
Chunk<ATTR>,PoolableChunk,WritableChunk<ATTR>,SafeCloseable,AutoCloseable
- Direct Known Subclasses:
ResettableWritableBooleanChunk
public class WritableBooleanChunk<ATTR extends Attributes.Any>
extends BooleanChunk<ATTR>
implements WritableChunk<ATTR>
WritableChunk implementation for boolean data.-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.Chunk
MAXIMUM_SIZE, SYSTEM_ARRAYCOPY_THRESHOLD, SYSTEM_ARRAYFILL_THRESHOLD -
Method Summary
Modifier and TypeMethodDescriptionfinal voidadd(boolean value) Add the specified value to the chunk.final voidappendTypedChunk(BooleanChunk<? extends ATTR> src, int srcOffset, int length) voidclose()final voidcopyFromArray(Object srcArray, int srcOffset, int destOffset, int length) final voidcopyFromChunk(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length) final voidcopyFromTypedArray(boolean[] src, int srcOffset, int destOffset, int length) final voidcopyFromTypedChunk(BooleanChunk<? extends ATTR> src, int srcOffset, int destOffset, int length) static <ATTR extends Attributes.Any,ATTR_DERIV extends ATTR>
WritableBooleanChunk<ATTR_DERIV>downcast(WritableBooleanChunk<ATTR> self) final voidfillWithBoxedValue(int offset, int size, Object value) Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.final voidfillWithValue(int offset, int length, boolean value) final ChunkFillerOur ChunkFiller "plugin".static <ATTR extends Attributes.Any>
WritableBooleanChunk<ATTR>makeWritableChunk(int size) Retrieve aWritableBooleanChunkof the specified size.static <ATTR extends Attributes.Any>
WritableBooleanChunk<ATTR>makeWritableChunkForPool(int size) Create aWritableBooleanChunkof the specified size.final voidset(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 voidsort()Sort this chunk in-place using Java's primitive defined ordering.static <ATTR extends Attributes.Any,ATTR_DERIV extends ATTR>
WritableBooleanChunk<ATTR>upcast(WritableBooleanChunk<ATTR_DERIV> self) static <ATTR extends Attributes.Any>
WritableBooleanChunk<ATTR>writableChunkWrap(boolean[] data) Wrap the specified array in aWritableBooleanChunk.static <ATTR extends Attributes.Any>
WritableBooleanChunk<ATTR>writableChunkWrap(boolean[] data, int offset, int size) Wrap the specified array in aWritableBooleanChunk.Methods inherited from class com.illumon.iris.db.v2.sources.chunk.BooleanChunk
chunkWrap, chunkWrap, copyToArray, copyToChunk, copyToTypedArray, get, getChunkType, getEmptyChunk, isAlias, isAlias, makeArrayMethods inherited from class com.illumon.iris.db.v2.sources.chunk.ChunkBase
internalCapacity, internalSetSize, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.Chunk
asBooleanChunk, asByteChunk, asCharChunk, asDoubleChunk, asFloatChunk, asIntChunk, asLongChunk, asObjectChunk, asShortChunk, copyToArray, copyToBuffer, copyToChunk, getChunkType, isAlias, isAlias, sizeMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.WritableChunk
asWritableBooleanChunk, asWritableByteChunk, asWritableCharChunk, asWritableDoubleChunk, asWritableFloatChunk, asWritableIntChunk, asWritableLongChunk, asWritableObjectChunk, asWritableShortChunk, capacity, copyFromBuffer, fillWithNullValue, internalCapacity, internalSetSize, setSize, sort
-
Method Details
-
makeWritableChunk
Retrieve aWritableBooleanChunkof the specified size.Note that the returned chunk may have a larger capacity than requested, and its size will be set to
size.Users must take care to
close()the chunk when finished.- Parameters:
size- the desired size of the chunk.- Returns:
- A
WritableBooleanChunkof the requested size.
-
makeWritableChunkForPool
public static <ATTR extends Attributes.Any> WritableBooleanChunk<ATTR> makeWritableChunkForPool(int size) Create aWritableBooleanChunkof the specified size. The returned chunk will have exactly the requested capacity, and its size will be set tosize.- Parameters:
size- the desired size of the chunk.- Returns:
- A
WritableBooleanChunkof the requested size.
-
writableChunkWrap
public static <ATTR extends Attributes.Any> WritableBooleanChunk<ATTR> writableChunkWrap(@NotNull boolean[] data) Wrap the specified array in aWritableBooleanChunk. TheChunkBase.size()will be initialized to thedatalength.- Parameters:
data- the array to wrap- Returns:
- A new
WritableBooleanChunkbacked by the specified array.
-
writableChunkWrap
public static <ATTR extends Attributes.Any> WritableBooleanChunk<ATTR> writableChunkWrap(@NotNull boolean[] data, int offset, int size) Wrap the specified array in aWritableBooleanChunk.- Parameters:
data- the array to wrap- Returns:
- A new
WritableBooleanChunkbacked by the specified array.
-
set
public final void set(int index, boolean value) -
add
public final void add(boolean value) Add the specified value to the chunk. The value will be added at the positionChunkBase.size(), and theChunkBase.size()will be incremented.- Parameters:
value- the value to add
-
slice
Description copied from interface:ChunkMake 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:
slicein interfaceChunk<ATTR extends Attributes.Any>- Specified by:
slicein interfaceWritableChunk<ATTR extends Attributes.Any>- Overrides:
slicein classBooleanChunk<ATTR extends Attributes.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.
-
fillWithBoxedValue
Description copied from interface:WritableChunkFill a sub-range of this writable chunk with the given value, unboxing it as appropriate.- Specified by:
fillWithBoxedValuein interfaceWritableChunk<ATTR extends Attributes.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:
copyFromChunkin interfaceWritableChunk<ATTR extends Attributes.Any>
-
copyFromTypedChunk
public final void copyFromTypedChunk(BooleanChunk<? extends ATTR> src, int srcOffset, int destOffset, int length) -
copyFromArray
- Specified by:
copyFromArrayin interfaceWritableChunk<ATTR extends Attributes.Any>
-
copyFromTypedArray
public final void copyFromTypedArray(boolean[] src, int srcOffset, int destOffset, int length) -
getChunkFiller
Description copied from interface:WritableChunkOur ChunkFiller "plugin".- Specified by:
getChunkFillerin interfaceWritableChunk<ATTR extends Attributes.Any>
-
sort
public final void sort()Description copied from interface:WritableChunkSort 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:
sortin interfaceWritableChunk<ATTR extends Attributes.Any>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-
upcast
public static <ATTR extends Attributes.Any,ATTR_DERIV extends ATTR> WritableBooleanChunk<ATTR> upcast(WritableBooleanChunk<ATTR_DERIV> self) -
downcast
public static <ATTR extends Attributes.Any,ATTR_DERIV extends ATTR> WritableBooleanChunk<ATTR_DERIV> downcast(WritableBooleanChunk<ATTR> self)
-