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.
  • 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

      public final ResettableObjectChunk slice(int offset, int capacity)
      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 interface Chunk<T>
      Overrides:
      slice in class ObjectChunk
      Parameters:
      offset - Offset of the new Chunk, relative to this Chunk. 0 ≤ offset ≤ this.size
      capacity - 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 specified Chunk.
      Specified by:
      resetFromChunk in interface ResettableReadOnlyChunk<T>
      Parameters:
      other - The other Chunk
      offset - The offset into other
      capacity - 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 interface ResettableChunk<T>
      Specified by:
      resetFromArray in interface ResettableReadOnlyChunk<T>
      Parameters:
      array - The array
      offset - The offset into array
      capacity - The capacity this should have after reset
      Returns:
      this
    • resetFromArray

      public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> resetFromArray(Object array)
      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 interface ResettableChunk<T>
      Specified by:
      resetFromArray in interface ResettableReadOnlyChunk<T>
      Parameters:
      array - The array
      Returns:
      this
    • clear

      public final <ATTR extends ATTR_UPPER> ObjectChunk<T,ATTR> clear()
      Description copied from interface: ResettableChunk
      Reset this chunk to empty storage.
      Specified by:
      clear in interface ResettableChunk<T>
      Specified by:
      clear in interface ResettableReadOnlyChunk<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 interface AutoCloseable
      Specified by:
      close in interface SafeCloseable