Package io.deephaven.chunk.sized
Class SizedChunk<T extends Any>
java.lang.Object
io.deephaven.chunk.sized.SizedChunk<T>
- Type Parameters:
T
- the attribute of the chunk
- All Implemented Interfaces:
SafeCloseable
,AutoCloseable
A dynamically typed chunk that can be resized.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
ensureCapacity
(int capacity) Ensure the underlying chunk has a capacity of at leastcapacity
.ensureCapacityPreserve
(int capacity) Ensure the underlying chunk has a capacity of at leastcapacity
.get()
Get the underlying chunk.
-
Constructor Details
-
SizedChunk
Create a SizedChunk of the given type.- Parameters:
chunkType
- the type of the chunk to create
-
-
Method Details
-
get
Get the underlying chunk.- Returns:
- the underlying chunk.
-
ensureCapacity
Ensure the underlying chunk has a capacity of at leastcapacity
. The data and size of the returned chunk are undefined.- Parameters:
capacity
- the minimum capacity for the chunk.- Returns:
- the underlying chunk
-
ensureCapacityPreserve
Ensure the underlying chunk has a capacity of at leastcapacity
. If the chunk has existing data, then it is copied to the new chunk. If the underlying chunk already exists, then the size of the chunk is the original size. If the chunk did not exist, then the size of the returned chunk is zero.- Parameters:
capacity
- the minimum capacity for the chunk.- Returns:
- the underlying chunk
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-