Class ContextWithChunk<ATTR extends io.deephaven.chunk.attributes.Any,CONTEXT extends io.deephaven.engine.table.Context>

java.lang.Object
io.deephaven.engine.table.impl.ContextWithChunk<ATTR,CONTEXT>
All Implemented Interfaces:
io.deephaven.engine.table.Context, io.deephaven.util.SafeCloseable, AutoCloseable
Direct Known Subclasses:
DefaultGetContext

public class ContextWithChunk<ATTR extends io.deephaven.chunk.attributes.Any,CONTEXT extends io.deephaven.engine.table.Context> extends Object implements io.deephaven.engine.table.Context
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    ensureSize(int length)
    Makes sure that the internal array (and hence the writableChunk) is at least the specified size.
     
    static <CONTEXT extends io.deephaven.engine.table.Context>
    CONTEXT
    getContext(@NotNull io.deephaven.engine.table.Context context)
     
    io.deephaven.chunk.ResettableChunk<ATTR>
     
    static <ATTR extends io.deephaven.chunk.attributes.Any, RESETTABLE_WRITABLE_CHUNK extends io.deephaven.chunk.ResettableWritableChunk<ATTR>>
    RESETTABLE_WRITABLE_CHUNK
    getResettableChunk(@NotNull io.deephaven.engine.table.Context context)
     
    io.deephaven.chunk.WritableChunk<ATTR>
     
    static <ATTR extends io.deephaven.chunk.attributes.Any, WRITABLE_CHUNK extends io.deephaven.chunk.WritableChunk<ATTR>>
    WRITABLE_CHUNK
    getWritableChunk(@NotNull io.deephaven.engine.table.Context context)
     
    static <ATTR extends io.deephaven.chunk.attributes.Any>
    boolean
    isMyResettableChunk(@NotNull io.deephaven.engine.table.Context context, io.deephaven.chunk.Chunk<ATTR> chunk)
    Checks if this chunk is the result of a call to getResettableChunk() or getResettableChunk(Context) with this context, followed by a some reset call, including the result of a call to resetChunkFromArray(Context, Object, int, int).
    static <ATTR extends io.deephaven.chunk.attributes.Any>
    boolean
    isMyWritableChunk(@NotNull io.deephaven.engine.table.Context context, io.deephaven.chunk.Chunk<ATTR> chunk)
    Checks if this chunk is the result of a call to getWritableChunk() or getWritableChunk(Context) with this context.
    static <ATTR extends io.deephaven.chunk.attributes.Any, CHUNK extends io.deephaven.chunk.Chunk<ATTR>>
    CHUNK
    resetChunkFromArray(@NotNull io.deephaven.engine.table.Context context, Object array, int offset, int length)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface io.deephaven.engine.table.Context
      Specified by:
      close in interface io.deephaven.util.SafeCloseable
    • getWritableChunk

      public io.deephaven.chunk.WritableChunk<ATTR> getWritableChunk()
      Returns:
      a WritableChunk which you can use for results
      ApiNote:
      the chunk is valid until the next call to this function, getResettableChunk(), getWritableChunk(Context), getResettableChunk(Context), or resetChunkFromArray(Context, Object, int, int) for this context.
    • getResettableChunk

      public io.deephaven.chunk.ResettableChunk<ATTR> getResettableChunk()
      Returns:
      a ResettableChunk chunk which you can use for results by calling one of its various reset methods.
      ApiNote:
      the chunk is valid until the next call to this function, getWritableChunk(), getWritableChunk(Context), getResettableChunk(Context), or resetChunkFromArray(Context, Object, int, int) for this context.
    • getContext

      public CONTEXT getContext()
      Returns:
      The context held in this Context
    • getContext

      public static <CONTEXT extends io.deephaven.engine.table.Context> CONTEXT getContext(@NotNull @NotNull io.deephaven.engine.table.Context context)
      Returns:
      The context held in this Context
    • ensureSize

      public void ensureSize(int length)
      Makes sure that the internal array (and hence the writableChunk) is at least the specified size.
    • getWritableChunk

      public static <ATTR extends io.deephaven.chunk.attributes.Any, WRITABLE_CHUNK extends io.deephaven.chunk.WritableChunk<ATTR>> WRITABLE_CHUNK getWritableChunk(@NotNull @NotNull io.deephaven.engine.table.Context context)
      Parameters:
      context - The context that owns the reusable chunk
      Returns:
      a WritableChunk which you can use for results. The size will be set to 0.
      ApiNote:
      the chunk is valid until the next call to this function, getWritableChunk(), getResettableChunk(), getResettableChunk(Context), or resetChunkFromArray(Context, Object, int, int) for this context.
    • getResettableChunk

      public static <ATTR extends io.deephaven.chunk.attributes.Any, RESETTABLE_WRITABLE_CHUNK extends io.deephaven.chunk.ResettableWritableChunk<ATTR>> RESETTABLE_WRITABLE_CHUNK getResettableChunk(@NotNull @NotNull io.deephaven.engine.table.Context context)
      Parameters:
      context - The context that owns the reusable chunk
      Returns:
      a ResettableWritableChunk, which you can use for results by using one of its various reset methods.
      ApiNote:
      the chunk is valid until the next call to this function, getWritableChunk(), getResettableChunk(), getWritableChunk(Context), resetChunkFromArray(Context, Object, int, int) for this context.
    • resetChunkFromArray

      public static <ATTR extends io.deephaven.chunk.attributes.Any, CHUNK extends io.deephaven.chunk.Chunk<ATTR>> CHUNK resetChunkFromArray(@NotNull @NotNull io.deephaven.engine.table.Context context, Object array, int offset, int length)
      Parameters:
      context - The context that owns the reusable chunk
      array - The array to alias. If this is null, returns a null-value filled chunk.
      offset - The offset in the array for the beginning of the chunk
      length - The length of the chunk
      Returns:
      A chunk which aliases the region of the array which can be used for results.
      ApiNote:
      the chunk is valid until the next call to this function, getWritableChunk(), getResettableChunk(), getWritableChunk(Context), or getResettableChunk(Context) for this context.
    • isMyWritableChunk

      public static <ATTR extends io.deephaven.chunk.attributes.Any> boolean isMyWritableChunk(@NotNull @NotNull io.deephaven.engine.table.Context context, io.deephaven.chunk.Chunk<ATTR> chunk)
      Checks if this chunk is the result of a call to getWritableChunk() or getWritableChunk(Context) with this context. This is primarily intended for testing and verification code.
    • isMyResettableChunk

      public static <ATTR extends io.deephaven.chunk.attributes.Any> boolean isMyResettableChunk(@NotNull @NotNull io.deephaven.engine.table.Context context, io.deephaven.chunk.Chunk<ATTR> chunk)
      Checks if this chunk is the result of a call to getResettableChunk() or getResettableChunk(Context) with this context, followed by a some reset call, including the result of a call to resetChunkFromArray(Context, Object, int, int). This is primarily intended for testing and verification code.