Package io.deephaven.chunk.util.pools
Class ObjectChunkSoftPool
java.lang.Object
io.deephaven.chunk.util.pools.ObjectChunkSoftPool
- All Implemented Interfaces:
ObjectChunkPool
ObjectChunkPool
implementation that pools chunks of Objects in a data structure that only enforces soft
reachability.-
Method Summary
Modifier and TypeMethodDescription<TYPE,
ATTR extends Any>
ResettableObjectChunk<TYPE,ATTR> Take aResettableObjectChunk
of at least the specifiedcapacity
.<TYPE,
ATTR extends Any>
ResettableWritableObjectChunk<TYPE,ATTR> Take aResettableWritableObjectChunk
of at least the specifiedcapacity
.<TYPE,
ATTR extends Any>
WritableObjectChunk<TYPE,ATTR> takeWritableObjectChunk
(int capacity) Take aWritableObjectChunk
of at least the specifiedcapacity
.
-
Method Details
-
asChunkPool
- Specified by:
asChunkPool
in interfaceObjectChunkPool
- Returns:
- This ObjectChunkPool as a
ChunkPool
. This is useful for passing this pool to methods that expect aChunkPool
but do not need to know the specific type.
-
takeWritableObjectChunk
public <TYPE,ATTR extends Any> WritableObjectChunk<TYPE,ATTR> takeWritableObjectChunk(int capacity) Description copied from interface:ObjectChunkPool
Take aWritableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeWritableObjectChunk
in interfaceObjectChunkPool
- Parameters:
capacity
- The minimum capacity for the result- Returns:
- A
WritableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableObjectChunk
Description copied from interface:ObjectChunkPool
Take aResettableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableObjectChunk
in interfaceObjectChunkPool
- Returns:
- A
ResettableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-
takeResettableWritableObjectChunk
public <TYPE,ATTR extends Any> ResettableWritableObjectChunk<TYPE,ATTR> takeResettableWritableObjectChunk()Description copied from interface:ObjectChunkPool
Take aResettableWritableObjectChunk
of at least the specifiedcapacity
. The result belongs to the caller untilclosed
.- Specified by:
takeResettableWritableObjectChunk
in interfaceObjectChunkPool
- Returns:
- A
ResettableWritableObjectChunk
of at least the specifiedcapacity
that belongs to the caller untilclosed
-