Class ResettableObjectChunk<T,ATTR_UPPER extends Attributes.Any>
java.lang.Object
com.illumon.iris.db.v2.sources.chunk.ChunkBase<ATTR>
com.illumon.iris.db.v2.sources.chunk.ObjectChunk
com.illumon.iris.db.v2.sources.chunk.ResettableObjectChunk<T,ATTR_UPPER>
- All Implemented Interfaces:
Chunk
,ResettableChunk<ATTR_UPPER>
,ResettableReadOnlyChunk<ATTR_UPPER>
,PoolableChunk
,SafeCloseable
,AutoCloseable
public final class ResettableObjectChunk<T,ATTR_UPPER extends Attributes.Any> extends ObjectChunk implements ResettableReadOnlyChunk<ATTR_UPPER>
ResettableReadOnlyChunk
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 <ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>clear()
Reset this chunk to empty storage.void
close()
static <T, ATTR_BASE extends Attributes.Any>
ResettableObjectChunk<T,ATTR_BASE>makeResettableChunk()
static <T, ATTR_BASE extends Attributes.Any>
ResettableObjectChunk<T,ATTR_BASE>makeResettableChunkForPool()
<ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>resetFromArray(Object array)
Reset the data and bounds of this chunk to the entire range of the specified array.<ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>resetFromArray(Object array, int offset, int capacity)
Reset the data and bounds of this chunk to a range or sub-range of the specified array.<ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>resetFromChunk(Chunk<? extends ATTR> other, int offset, int capacity)
Reset the data and bounds of this chunk to a range or sub-range of the specifiedChunk
.<ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>resetFromTypedArray(T[] data, int offset, int capacity)
<ATTR extends ATTR_UPPER>
ObjectChunk<T,ATTR>resetFromTypedChunk(ObjectChunk<T,? extends ATTR> other, int offset, int capacity)
ResettableObjectChunk
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.Methods inherited from class com.illumon.iris.db.v2.sources.chunk.ObjectChunk
asTypedObjectChunk, chunkWrap, chunkWrap, copyToArray, copyToChunk, copyToTypedArray, downcast, get, getChunkType, getEmptyChunk, isAlias, isAlias, makeArray
Methods inherited from class com.illumon.iris.db.v2.sources.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 com.illumon.iris.db.v2.sources.chunk.Chunk
asBooleanChunk, asByteChunk, asCharChunk, asDoubleChunk, asFloatChunk, asIntChunk, asLongChunk, asObjectChunk, asShortChunk, copyToArray, copyToBuffer, copyToChunk, getChunkType, isAlias, isAlias, size
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ResettableReadOnlyChunk
asResettableBooleanChunk, asResettableByteChunk, asResettableCharChunk, asResettableDoubleChunk, asResettableFloatChunk, asResettableIntChunk, asResettableLongChunk, asResettableObjectChunk, asResettableShortChunk, resetFromChunk
-
Method Details
-
makeResettableChunk
public static <T, ATTR_BASE extends Attributes.Any> ResettableObjectChunk<T,ATTR_BASE> makeResettableChunk() -
makeResettableChunkForPool
public static <T, ATTR_BASE extends Attributes.Any> ResettableObjectChunk<T,ATTR_BASE> makeResettableChunkForPool() -
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<T>
- Overrides:
slice
in classObjectChunk
- 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.
-
resetFromChunk
public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> resetFromChunk(Chunk<? extends ATTR> other, int offset, int capacity)Description copied from interface:ResettableReadOnlyChunk
Reset the data and bounds of this chunk to a range or sub-range of the specifiedChunk
.- Specified by:
resetFromChunk
in interfaceResettableReadOnlyChunk<T>
- Parameters:
other
- The otherChunk
offset
- The offset into othercapacity
- The capacity this should have after reset
-
resetFromArray
public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> resetFromArray(Object array, int offset, int capacity)Description copied from interface:ResettableChunk
Reset the data and bounds of this chunk to a range or sub-range of the specified array.- Specified by:
resetFromArray
in interfaceResettableChunk<T>
- Specified by:
resetFromArray
in interfaceResettableReadOnlyChunk<T>
- Parameters:
array
- The arrayoffset
- The offset into arraycapacity
- The capacity this should have after reset- Returns:
- this
-
resetFromArray
Description copied from interface:ResettableChunk
Reset the data and bounds of this chunk to the entire range of the specified array.- Specified by:
resetFromArray
in interfaceResettableChunk<T>
- Specified by:
resetFromArray
in interfaceResettableReadOnlyChunk<T>
- Parameters:
array
- The array- Returns:
- this
-
clear
Description copied from interface:ResettableChunk
Reset this chunk to empty storage.- Specified by:
clear
in interfaceResettableChunk<T>
- Specified by:
clear
in interfaceResettableReadOnlyChunk<T>
-
resetFromTypedChunk
public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> resetFromTypedChunk(ObjectChunk<T,? extends ATTR> other, int offset, int capacity) -
resetFromTypedArray
public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> resetFromTypedArray(T[] data, int offset, int capacity) -
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-