Class ColumnHolder<T>
java.lang.Object
io.deephaven.engine.table.impl.util.ColumnHolder<T>
Data to construct a data column.
-
Field Summary
Modifier and TypeFieldDescriptionfinal Class<?>
The data's component type of the column.The data type of the column.final boolean
Should the result column be indexed? This is only supported by test utilities; non-test usages should manually add and manage data indexes.final String
The name of the column.static final ColumnHolder[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
ColumnHolder
(boolean chunkSentinel, String name, Class<?> dataType, Class<?> componentType, boolean indexed, Chunk<Values> chunkData) Construct a new set of column data with a specified type using a chunk.ColumnHolder
(String name, boolean indexed, byte... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, char... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, double... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, float... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, int... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, long... arrayData) Construct a new set of column data.ColumnHolder
(String name, boolean indexed, short... arrayData) Construct a new set of column data.ColumnHolder
(String name, Class<T> dataType, Class<?> componentType, boolean indexed, T... arrayData) Construct a new set of column data. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ColumnHolder<T>
createColumnHolder
(String name, boolean indexed, T... data) Create a column holder from an array object, inferring the data type from the given array object.static ColumnHolder<Boolean>
getBooleanColumnHolder
(String name, boolean indexed, byte... data) Create a column holder for a Boolean column where the values are represented as bytes.getChunk()
ColumnSource<?>
Gets a column source for the data.static ColumnHolder<Instant>
getInstantColumnHolder
(String name, boolean indexed, long... data) Create a column holder for an Instant column where the values are represented as longs.static ColumnHolder<Instant>
getInstantColumnHolder
(String name, boolean indexed, Chunk<Values> chunkData) Create a column holder for an Instant column where the values are represented as longs.getName()
static <T> ColumnHolder<T>
makeForChunk
(String name, Class<T> type, Class<?> componentType, boolean indexed, Chunk<Values> chunkData) int
size()
-
Field Details
-
ZERO_LENGTH_COLUMN_HOLDER_ARRAY
-
name
The name of the column. -
dataType
The data type of the column. -
componentType
The data's component type of the column. -
indexed
public final boolean indexedShould the result column be indexed? This is only supported by test utilities; non-test usages should manually add and manage data indexes. Only use this when enclosed by aLivenessScope
that was constructed withenforceStrongReachability == true
.
-
-
Constructor Details
-
ColumnHolder
public ColumnHolder(String name, Class<T> dataType, Class<?> componentType, boolean indexed, T... arrayData) Construct a new set of column data.- Parameters:
name
- column namedataType
- column data typecomponentType
- column component type (for array or>
data types)arrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisearrayData
- column data
-
ColumnHolder
protected ColumnHolder(boolean chunkSentinel, String name, Class<?> dataType, Class<?> componentType, boolean indexed, Chunk<Values> chunkData) Construct a new set of column data with a specified type using a chunk. This overload allows the creation of a ColumnHolder where the official data type type does not match the data.- Parameters:
name
- column namedataType
- abstract data type for the columnindexed
- true if the column is indexed; false otherwisechunkData
- column data
-
-
Method Details
-
makeForChunk
-
getInstantColumnHolder
public static ColumnHolder<Instant> getInstantColumnHolder(String name, boolean indexed, long... data) Create a column holder for an Instant column where the values are represented as longs. Whatever process produces a table from this column holder should respect this and create the appropriate type of ColumnSource. Under normal conditions, this will be an InstantArraySource (seegetColumnSource()
).- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisedata
- column data (long integers representing nanos since the epoch)
-
getInstantColumnHolder
public static ColumnHolder<Instant> getInstantColumnHolder(String name, boolean indexed, Chunk<Values> chunkData) Create a column holder for an Instant column where the values are represented as longs. Whatever process produces a table from this column holder should respect this and create the appropriate type of ColumnSource. Under normal conditions, this will be an InstantArraySource (seegetColumnSource()
).- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisechunkData
- column data (long integers representing nanos since the epoch)
-
getBooleanColumnHolder
public static ColumnHolder<Boolean> getBooleanColumnHolder(String name, boolean indexed, byte... data) Create a column holder for a Boolean column where the values are represented as bytes. The given byte array will be converted to a Boolean array.- Parameters:
name
- column nameindexed
- true if the column is indexed; false otherwisedata
- column data (byte values where 1 represents true, 0 represents false, and null otherwise)- Returns:
- a Boolean column holder
-
createColumnHolder
Create a column holder from an array object, inferring the data type from the given array object.- Parameters:
name
- The column nameindexed
- true if the column is indexed; false otherwisedata
- The data array- Returns:
- a column holder with a type matching the component type of the provided array
-
getName
-
getColumnSource
Gets a column source for the data. Other than the special case of Instant columns, this requires that the type specified match the component type of the actual data.- Returns:
- column source constructed with data from this column holder
-
getArrayData
-
getChunkData
-
getChunk
-
size
public int size()
-