Package com.illumon.iris.db.v2.utils
Class ColumnHolder
java.lang.Object
com.illumon.iris.db.v2.utils.ColumnHolder
public class ColumnHolder extends Object
Data to construct a data column.
-
Field Summary
Fields Modifier and Type Field Description Object
data
boolean
grouped
String
name
Class
type
static ColumnHolder[]
ZERO_LENGTH_COLUMN_HOLDER_ARRAY
-
Constructor Summary
Constructors Constructor Description ColumnHolder(String name, boolean grouped, byte... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, char... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, double... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, float... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, int... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, long... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, short... data)
Construct a new set of column data.ColumnHolder(String name, boolean grouped, T... data)
Construct a new set of column data.ColumnHolder(String name, Class<T> clazz, T... data)
Construct a new set of column data. -
Method Summary
Modifier and Type Method Description static ColumnHolder
getBooleanColumnHolder(String name, boolean grouped, byte... data)
Create a column holder for a Boolean column where the calues are represented as bytes.static ColumnHolder
getColumnHolderFromArray(String name, boolean grouped, Object data)
Create a column holder from an array object, inferring the data type from the given array object.ColumnSource
getColumnSource()
Gets a column source for the data.static ColumnHolder
getDateTimeColumnHolder(String name, boolean grouped, long... data)
Create a column holder for a DateTime column where the values are represented as longs.
-
Field Details
-
ZERO_LENGTH_COLUMN_HOLDER_ARRAY
-
name
-
type
-
data
-
grouped
public final boolean grouped
-
-
Constructor Details
-
ColumnHolder
Construct a new set of column data.- Type Parameters:
T
- column element type- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Type Parameters:
T
- column element type- Parameters:
name
- column namedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
ColumnHolder
Construct a new set of column data.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data
-
-
Method Details
-
getDateTimeColumnHolder
Create a column holder for a DateTime 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 a DateTimeArraySource (seegetColumnSource()
).- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data (long integers representing nanos since the epoch)- Returns:
- a DBDateTime column holder implemented with longs for storage
-
getBooleanColumnHolder
Create a column holder for a Boolean column where the calues are represented as bytes. The given byte array will be converted to a Boolean array.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- column data (byte values where 1 represents true, 0 represents false, and null otherwise)- Returns:
- a Boolean column holder
-
getColumnHolderFromArray
Create a column holder from an array object, inferring the data type from the given array object.- Parameters:
name
- column namegrouped
- true if the column is grouped; false otherwisedata
- an object holding the column data (must be an array)- Returns:
- a column holder with a type matching the component type of the provided array
-
getColumnSource
Gets a column source for the data. Other than the special case of DBDateTime 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
-