Class ColumnVectors
Vectors
from the columns of a Table
, enabling random and bulk
access to column data by row position.
Users should note that random access by row position (e.g. get
methods) maybe be inefficient due to the need
to convert row positions to row keys and acquire implementation-specific resources once per row. Thus, random access
should generally be avoided when possible. On the other hand, bulk access methods (e.g. iterator
and
toArray
methods) are generally quite efficient because they can amortize row position to row key conversions
via iteration patterns and use bulk data movement operators.
Most usage of these APIs is perfectly safe, because script commands are run using an exclusive lock that inhibits
concurrent update processing, and table listeners run during a period when it is always safe to access previous and
current data for the table. That said, if the table is refreshing
, it's important to
note that the returned vectors are only valid for use during the current cycle (or
Updating
phase, when
usePreviousValues = true
). See
Engine Locking for more
information on safe, consistent data access. Direct vectors
or copied arrays
are always safe to use if they are created while the vector is valid.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Vector<?>
Get aVector
of the data belonging to the specified column.static Vector<?>
Get aVector
of the data belonging to the specified column.static ByteVector
static ByteVector
static CharVector
static CharVector
static DoubleVector
static DoubleVector
static FloatVector
static FloatVector
static IntVector
static IntVector
static LongVector
static LongVector
static <DATA_TYPE>
ObjectVector<DATA_TYPE>static <DATA_TYPE>
ObjectVector<DATA_TYPE>ofObject
(@NotNull Table table, @NotNull String columnName, @NotNull Class<DATA_TYPE> type, boolean usePreviousValues) static ShortVector
static ShortVector
-
Method Details
-
of
Get aVector
of the data belonging to the specified column.See
class-level documentation
for more details on recommended usage and safety.Users should generally prefer one of the typed variants, e.g.
ofChar
orofObject
, rather than this method. -
of
public static Vector<?> of(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aVector
of the data belonging to the specified column.See
class-level documentation
for more details on recommended usage and safety.Users should generally prefer one of the typed variants, e.g.
ofChar
orofObject
, rather than this method.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
Vector
of the data belonging to the specified column
-
ofChar
Get aCharVector
of the data belonging to the specified column, which must be oftype
char
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
CharVector
of the data belonging to the specified column
-
ofChar
public static CharVector ofChar(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aCharVector
of the data belonging to the specified column, which must be oftype
char
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
CharVector
of the data belonging to the specified column
-
ofByte
Get aByteVector
of the data belonging to the specified column, which must be oftype
byte
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
ByteVector
of the data belonging to the specified column
-
ofByte
public static ByteVector ofByte(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aByteVector
of the data belonging to the specified column, which must be oftype
byte
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
ByteVector
of the data belonging to the specified column
-
ofShort
public static ShortVector ofShort(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aShortVector
of the data belonging to the specified column, which must be oftype
short
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
ShortVector
of the data belonging to the specified column
-
ofShort
public static ShortVector ofShort(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aShortVector
of the data belonging to the specified column, which must be oftype
short
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
ShortVector
of the data belonging to the specified column
-
ofInt
Get anIntVector
of the data belonging to the specified column, which must be oftype
int
.See
class-level documentation
for more details on recommended usage and safety. -
ofInt
public static IntVector ofInt(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get anIntVector
of the data belonging to the specified column, which must be oftype
int
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- An
IntVector
of the data belonging to the specified column
-
ofLong
Get aLongVector
of the data belonging to the specified column, which must be oftype
long
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
LongVector
of the data belonging to the specified column
-
ofLong
public static LongVector ofLong(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aLongVector
of the data belonging to the specified column, which must be oftype
long
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
LongVector
of the data belonging to the specified column
-
ofFloat
public static FloatVector ofFloat(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aFloatVector
of the data belonging to the specified column, which must be oftype
float
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
FloatVector
of the data belonging to the specified column
-
ofFloat
public static FloatVector ofFloat(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aFloatVector
of the data belonging to the specified column, which must be oftype
float
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
FloatVector
of the data belonging to the specified column
-
ofDouble
public static DoubleVector ofDouble(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aDoubleVector
of the data belonging to the specified column, which must be oftype
double
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to access- Returns:
- A
DoubleVector
of the data belonging to the specified column
-
ofDouble
public static DoubleVector ofDouble(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aDoubleVector
of the data belonging to the specified column, which must be oftype
double
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accessusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- A
DoubleVector
of the data belonging to the specified column
-
ofObject
public static <DATA_TYPE> ObjectVector<DATA_TYPE> ofObject(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, @NotNull @NotNull Class<DATA_TYPE> type) Get anObjectVector
of the data belonging to the specified column, which must be oftype
DATA_TYPE
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accesstype
- The data type of the column- Returns:
- An
ObjectVector
of the data belonging to the specified column
-
ofObject
public static <DATA_TYPE> ObjectVector<DATA_TYPE> ofObject(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, @NotNull @NotNull Class<DATA_TYPE> type, boolean usePreviousValues) Get anObjectVector
of the data belonging to the specified column, which must be oftype
DATA_TYPE
.See
class-level documentation
for more details on recommended usage and safety.- Parameters:
table
- TheTable
to access column data fromcolumnName
- The name of the column to accesstype
- The data type of the columnusePreviousValues
- Whether the resulting vector should contain the previous values of the column. This is only meaningful iftable
isrefreshing
, and only defined during theUpdating
phase of a cycle that isn't the instantiation cycle oftable
.- Returns:
- An
ObjectVector
of the data belonging to the specified column
-