Interface WritableChunk<ATTR extends Any>
- Type Parameters:
ATTR
- Descriptive attribute that applies to the elements stored within this WritableChunk
- All Superinterfaces:
AutoCloseable
,Chunk<ATTR>
,PoolableChunk
,SafeCloseable
- All Known Subinterfaces:
ResettableWritableChunk<ATTR_BASE>
- All Known Implementing Classes:
ResettableWritableBooleanChunk
,ResettableWritableByteChunk
,ResettableWritableCharChunk
,ResettableWritableDoubleChunk
,ResettableWritableFloatChunk
,ResettableWritableIntChunk
,ResettableWritableLongChunk
,ResettableWritableObjectChunk
,ResettableWritableShortChunk
,WritableBooleanChunk
,WritableByteChunk
,WritableCharChunk
,WritableDoubleChunk
,WritableFloatChunk
,WritableIntChunk
,WritableLongChunk
,WritableObjectChunk
,WritableShortChunk
-
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
-
Method Summary
Modifier and TypeMethodDescriptiondefault WritableBooleanChunk<ATTR>
default WritableByteChunk<ATTR>
default WritableCharChunk<ATTR>
default WritableDoubleChunk<ATTR>
default WritableFloatChunk<ATTR>
default WritableIntChunk<ATTR>
default WritableLongChunk<ATTR>
default <T> WritableObjectChunk<T,
ATTR> default WritableShortChunk<ATTR>
default int
capacity()
void
copyFromArray
(Object srcArray, int srcOffset, int destOffset, int length) default void
copyFromBuffer
(Buffer srcBuffer, int srcOffset, int destOffset, int length) Fill a sub-range of this writable chunk with values from aBuffer
.void
copyFromChunk
(Chunk<? extends ATTR> src, int srcOffset, int destOffset, int length) default void
fillWithBoxedValue
(int offset, int size, Object value) Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.default void
fillWithNullValue
(int offset, int size) Fill a sub-range of this writable chunk with the appropriate Deephaven null value for the type.int
internalCapacity
(long password) DO NOT CALL THIS INTERNAL METHOD.void
internalSetSize
(int newSize, long password) DO NOT CALL THIS INTERNAL METHOD.default void
setSize
(int newSize) 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.void
sort()
Sort this chunk in-place using Java's primitive defined ordering.default void
sort
(int start, int length) Sort this chunk in-place using Java's primitive defined ordering.static <ATTR extends Any,
ATTR_DERIV extends ATTR>
WritableChunk<ATTR>upcast
(WritableChunk<ATTR_DERIV> self) Upcast the attribute.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.util.SafeCloseable
close
-
Method Details
-
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>
- 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
default void fillWithNullValue(int offset, int size) Fill a sub-range of this writable chunk with the appropriate Deephaven null value for the type.- Parameters:
offset
- Starting offsetsize
- Number of values to fill
-
fillWithBoxedValue
Fill a sub-range of this writable chunk with the given value, unboxing it as appropriate.- Parameters:
offset
- Starting offsetsize
- Number of values to fill
-
copyFromChunk
-
copyFromArray
-
copyFromBuffer
Fill a sub-range of this writable chunk with values from a
Buffer
. This is an optional method, as some chunk types do not have a corresponding buffer type.Implementations are free to copy data as efficiently as they may, and will use absolute rather than positional access where possible. To facilitate this pattern,
srcOffset
is an absolute offset from position 0, rather than a relative offset fromsrcBuffer.position()
.It is required that
srcBuffer.limit()
is at leastsrcOffset + length
.srcBuffer
's position may be modified, but will always be restored to its initial value upon successful return.- Parameters:
srcBuffer
- The source buffer, which will be cast to the appropriate type for this chunksrcOffset
- The offset intosrcBuffer
(from position 0, notsrcBuffer.position()
) to start copying fromdestOffset
- The offset into this chunk to start copying tolength
- The number of elements to copy
-
setSize
default void setSize(int newSize) -
internalSetSize
void internalSetSize(int newSize, long password) DO NOT CALL THIS INTERNAL METHOD. If you want to set a size, callsetSize(int)
. That method is the only legal caller of this method in the entire system. -
capacity
default int capacity() -
internalCapacity
int internalCapacity(long password) DO NOT CALL THIS INTERNAL METHOD. Callcapacity()
That method is the only legal caller of this method in the entire system. -
sort
void sort()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.
-
sort
default void sort(int start, int length) 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.
-
asWritableByteChunk
-
asWritableBooleanChunk
-
asWritableCharChunk
-
asWritableShortChunk
-
asWritableIntChunk
-
asWritableLongChunk
-
asWritableFloatChunk
-
asWritableDoubleChunk
-
asWritableObjectChunk
-
upcast
static <ATTR extends Any,ATTR_DERIV extends ATTR> WritableChunk<ATTR> upcast(WritableChunk<ATTR_DERIV> self) Upcast the attribute.When you know the data you will receive in this chunk from another source is a more specific sub-type than the source provides, you can upcast the attribute with this helper method (such as reading RowKeys from a ColumnSource which thinks they are just Values.)
- ApiNote:
- Downcast should not be necessary on WritableChunks, as a WritableChunk filling method should accept an lower bound wildcard.
-