Class SizedBooleanChunk<T extends Attributes.Any>
java.lang.Object
com.illumon.iris.db.v2.sources.chunk.sized.SizedBooleanChunk<T>
- Type Parameters:
T
- the chunk's attribute
- All Implemented Interfaces:
SafeCloseable
,AutoCloseable
public final class SizedBooleanChunk<T extends Attributes.Any> extends Object implements SafeCloseable
A wrapper for a boolean chunk that allows you to resize the chunk to a capacity.
-
Constructor Summary
Constructors Constructor Description SizedBooleanChunk()
SizedBooleanChunk(int initialSize)
-
Method Summary
Modifier and Type Method Description void
close()
WritableBooleanChunk<T>
ensureCapacity(int capacity)
Ensure the underlying chunk has a capacity of at leastcapacity
, preserving data.WritableBooleanChunk<T>
ensureCapacityPreserve(int capacity)
Ensure the underlying chunk has a capacity of at leastcapacity
.WritableBooleanChunk<T>
get()
Get the underlying chunk.
-
Constructor Details
-
SizedBooleanChunk
public SizedBooleanChunk() -
SizedBooleanChunk
public SizedBooleanChunk(int initialSize)
-
-
Method Details
-
get
Get the underlying chunk.- Returns:
- the underlying chunk.
-
ensureCapacity
Ensure the underlying chunk has a capacity of at leastcapacity
, preserving data. The data and size of the returned chunk are undefined. If you must maintain the data, then useensureCapacityPreserve(int)
.- 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
-