Class WritableObjectChunk<T,ATTR extends Attributes.Any>
java.lang.Object
com.illumon.iris.db.v2.sources.chunk.ChunkBase<ATTR>
com.illumon.iris.db.v2.sources.chunk.ObjectChunk<T,ATTR>
com.illumon.iris.db.v2.sources.chunk.WritableObjectChunk<T,ATTR>
- All Implemented Interfaces:
Chunk<ATTR>,PoolableChunk,WritableChunk<ATTR>,SafeCloseable,AutoCloseable
- Direct Known Subclasses:
ResettableWritableObjectChunk
public class WritableObjectChunk<T,ATTR extends Attributes.Any> extends ObjectChunk<T,ATTR> implements WritableChunk<ATTR>
WritableChunk implementation for Object 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 Type Method Description voidadd(T value)voidappendTypedChunk(ObjectChunk<T,? extends ATTR> src, int srcOffset, int length)<T_DERIV extends T>
WritableObjectChunk<T_DERIV,ATTR>asTypedWritableObjectChunk()voidclose()voidcopyFromArray(Object srcArray, int srcOffset, int destOffset, int length)voidcopyFromChunk(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length)voidcopyFromTypedArray(T[] src, int srcOffset, int destOffset, int length)voidcopyFromTypedChunk(ObjectChunk<T,? extends ATTR> src, int srcOffset, int destOffset, int length)static <T, ATTR extends Attributes.Any, ATTR_DERIV extends ATTR>
WritableObjectChunk<T,ATTR_DERIV>downcast(WritableObjectChunk<T,ATTR> self)voidfillWithBoxedValue(int offset, int size, Object value)Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.voidfillWithNullValue(int offset, int length)Fill a sub-range of this writable chunk with the appropriate Deephaven null value for the type.voidfillWithValue(int offset, int length, T value)ChunkFillergetChunkFiller()Our ChunkFiller "plugin".static <T, ATTR extends Attributes.Any>
WritableObjectChunk<T,ATTR>makeWritableChunk(int size)static WritableObjectChunkmakeWritableChunkForPool(int size)voidset(int index, T value)WritableObjectChunk<T,ATTR>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.voidsort()Sort this chunk in-place using Java's primitive defined ordering.voidsort(int start, int length)Sort this chunk in-place using Java's primitive defined ordering.static <T, ATTR extends Attributes.Any, ATTR_DERIV extends ATTR>
WritableObjectChunk<T,ATTR>upcast(WritableObjectChunk<T,ATTR_DERIV> self)static <T, ATTR extends Attributes.Any>
WritableObjectChunk<T,ATTR>writableChunkWrap(T[] data)static <T, ATTR extends Attributes.Any>
WritableObjectChunk<T,ATTR>writableChunkWrap(T[] data, int offset, int size)Methods inherited from class com.illumon.iris.db.v2.sources.chunk.ObjectChunk
asTypedObjectChunk, 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, internalCapacity, internalSetSize, setSize
-
Method Details
-
makeWritableChunk
public static <T, ATTR extends Attributes.Any> WritableObjectChunk<T,ATTR> makeWritableChunk(int size) -
makeWritableChunkForPool
-
writableChunkWrap
public static <T, ATTR extends Attributes.Any> WritableObjectChunk<T,ATTR> writableChunkWrap(T[] data) -
writableChunkWrap
public static <T, ATTR extends Attributes.Any> WritableObjectChunk<T,ATTR> writableChunkWrap(T[] data, int offset, int size) -
set
-
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<T>- Specified by:
slicein interfaceWritableChunk<T>- Overrides:
slicein classObjectChunk<T,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.
-
fillWithNullValue
public final void fillWithNullValue(int offset, int length)Description copied from interface:WritableChunkFill a sub-range of this writable chunk with the appropriate Deephaven null value for the type.- Specified by:
fillWithNullValuein interfaceWritableChunk<T>- Parameters:
offset- Starting offsetlength- Number of values to fill
-
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<T>- Parameters:
offset- Starting offsetsize- Number of values to fill
-
fillWithValue
-
appendTypedChunk
-
copyFromChunk
public final void copyFromChunk(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length)- Specified by:
copyFromChunkin interfaceWritableChunk<T>
-
copyFromTypedChunk
public final void copyFromTypedChunk(ObjectChunk<T,? extends ATTR> src, int srcOffset, int destOffset, int length) -
copyFromArray
- Specified by:
copyFromArrayin interfaceWritableChunk<T>
-
copyFromTypedArray
-
getChunkFiller
Description copied from interface:WritableChunkOur ChunkFiller "plugin".- Specified by:
getChunkFillerin interfaceWritableChunk<T>
-
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<T>
-
sort
public final void sort(int start, int length)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<T>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-
asTypedWritableObjectChunk
-
upcast
public static <T, ATTR extends Attributes.Any, ATTR_DERIV extends ATTR> WritableObjectChunk<T,ATTR> upcast(WritableObjectChunk<T,ATTR_DERIV> self) -
downcast
public static <T, ATTR extends Attributes.Any, ATTR_DERIV extends ATTR> WritableObjectChunk<T,ATTR_DERIV> downcast(WritableObjectChunk<T,ATTR> self)
-