Package io.deephaven.engine.table.impl
Class ContextWithChunk<ATTR extends Any,CONTEXT extends Context>
java.lang.Object
io.deephaven.engine.table.impl.ContextWithChunk<ATTR,CONTEXT>
- All Implemented Interfaces:
Context,SafeCloseable,AutoCloseable
- Direct Known Subclasses:
DefaultGetContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release any resources associated with this context.voidensureSize(int length) Makes sure that the internal array (and hence the writableChunk) is at least the specified size.static <CONTEXT extends Context>
CONTEXTgetContext(@NotNull Context context) static <ATTR extends Any,RESETTABLE_WRITABLE_CHUNK extends ResettableWritableChunk<ATTR>>
RESETTABLE_WRITABLE_CHUNKgetResettableChunk(@NotNull Context context) static <ATTR extends Any,WRITABLE_CHUNK extends WritableChunk<ATTR>>
WRITABLE_CHUNKgetWritableChunk(@NotNull Context context) static <ATTR extends Any>
booleanisMyResettableChunk(@NotNull Context context, Chunk<ATTR> chunk) Checks if this chunk is the result of a call togetResettableChunk()orgetResettableChunk(Context)with this context, followed by a some reset call, including the result of a call toresetChunkFromArray(Context, Object, int, int).static <ATTR extends Any>
booleanisMyWritableChunk(@NotNull Context context, Chunk<ATTR> chunk) Checks if this chunk is the result of a call togetWritableChunk()orgetWritableChunk(Context)with this context.resetChunkFromArray(@NotNull Context context, Object array, int offset, int length)
-
Method Details
-
close
public void close()Description copied from interface:ContextRelease any resources associated with this context. The context should not be used afterwards.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceContext- Specified by:
closein interfaceSafeCloseable
-
getWritableChunk
- Returns:
- a
WritableChunkwhich you can use for results - ApiNote:
- the chunk is valid until the next call to this function,
getResettableChunk(),getWritableChunk(Context),getResettableChunk(Context), orresetChunkFromArray(Context, Object, int, int)for this context.
-
getResettableChunk
- Returns:
- a
ResettableChunkchunk 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), orresetChunkFromArray(Context, Object, int, int)for this context.
-
getContext
- Returns:
- The context held in this Context
-
getContext
- 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 Any,WRITABLE_CHUNK extends WritableChunk<ATTR>> WRITABLE_CHUNK getWritableChunk(@NotNull @NotNull Context context) - Parameters:
context- The context that owns the reusable chunk- Returns:
- a
WritableChunkwhich 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), orresetChunkFromArray(Context, Object, int, int)for this context.
-
getResettableChunk
public static <ATTR extends Any,RESETTABLE_WRITABLE_CHUNK extends ResettableWritableChunk<ATTR>> RESETTABLE_WRITABLE_CHUNK getResettableChunk(@NotNull @NotNull 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 Any,CHUNK extends Chunk<ATTR>> CHUNK resetChunkFromArray(@NotNull @NotNull Context context, Object array, int offset, int length) - Parameters:
context- The context that owns the reusable chunkarray- 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 chunklength- 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), orgetResettableChunk(Context)for this context.
-
isMyWritableChunk
public static <ATTR extends Any> boolean isMyWritableChunk(@NotNull @NotNull Context context, Chunk<ATTR> chunk) Checks if this chunk is the result of a call togetWritableChunk()orgetWritableChunk(Context)with this context. This is primarily intended for testing and verification code. -
isMyResettableChunk
public static <ATTR extends Any> boolean isMyResettableChunk(@NotNull @NotNull Context context, Chunk<ATTR> chunk) Checks if this chunk is the result of a call togetResettableChunk()orgetResettableChunk(Context)with this context, followed by a some reset call, including the result of a call toresetChunkFromArray(Context, Object, int, int). This is primarily intended for testing and verification code.
-