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 aVectorof the data belonging to the specified column.static Vector<?>Get aVectorof the data belonging to the specified column.static ByteVectorstatic ByteVectorstatic CharVectorstatic CharVectorstatic DoubleVectorstatic DoubleVectorstatic FloatVectorstatic FloatVectorstatic IntVectorstatic IntVectorstatic LongVectorstatic LongVectorstatic <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 ShortVectorstatic ShortVector
-
Method Details
-
of
Get aVectorof the data belonging to the specified column.See
class-level documentationfor more details on recommended usage and safety.Users should generally prefer one of the typed variants, e.g.
ofCharorofObject, rather than this method. -
of
public static Vector<?> of(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aVectorof the data belonging to the specified column.See
class-level documentationfor more details on recommended usage and safety.Users should generally prefer one of the typed variants, e.g.
ofCharorofObject, rather than this method.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
Vectorof the data belonging to the specified column
-
ofChar
Get aCharVectorof the data belonging to the specified column, which must be oftypechar.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
CharVectorof the data belonging to the specified column
-
ofChar
public static CharVector ofChar(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aCharVectorof the data belonging to the specified column, which must be oftypechar.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
CharVectorof the data belonging to the specified column
-
ofByte
Get aByteVectorof the data belonging to the specified column, which must be oftypebyte.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
ByteVectorof the data belonging to the specified column
-
ofByte
public static ByteVector ofByte(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aByteVectorof the data belonging to the specified column, which must be oftypebyte.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
ByteVectorof the data belonging to the specified column
-
ofShort
public static ShortVector ofShort(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aShortVectorof the data belonging to the specified column, which must be oftypeshort.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
ShortVectorof the data belonging to the specified column
-
ofShort
public static ShortVector ofShort(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aShortVectorof the data belonging to the specified column, which must be oftypeshort.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
ShortVectorof the data belonging to the specified column
-
ofInt
Get anIntVectorof the data belonging to the specified column, which must be oftypeint.See
class-level documentationfor more details on recommended usage and safety. -
ofInt
public static IntVector ofInt(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get anIntVectorof the data belonging to the specified column, which must be oftypeint.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- An
IntVectorof the data belonging to the specified column
-
ofLong
Get aLongVectorof the data belonging to the specified column, which must be oftypelong.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
LongVectorof the data belonging to the specified column
-
ofLong
public static LongVector ofLong(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aLongVectorof the data belonging to the specified column, which must be oftypelong.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
LongVectorof the data belonging to the specified column
-
ofFloat
public static FloatVector ofFloat(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aFloatVectorof the data belonging to the specified column, which must be oftypefloat.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
FloatVectorof the data belonging to the specified column
-
ofFloat
public static FloatVector ofFloat(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aFloatVectorof the data belonging to the specified column, which must be oftypefloat.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
FloatVectorof the data belonging to the specified column
-
ofDouble
public static DoubleVector ofDouble(@NotNull @NotNull Table table, @NotNull @NotNull String columnName) Get aDoubleVectorof the data belonging to the specified column, which must be oftypedouble.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to access- Returns:
- A
DoubleVectorof the data belonging to the specified column
-
ofDouble
public static DoubleVector ofDouble(@NotNull @NotNull Table table, @NotNull @NotNull String columnName, boolean usePreviousValues) Get aDoubleVectorof the data belonging to the specified column, which must be oftypedouble.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- A
DoubleVectorof 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 anObjectVectorof the data belonging to the specified column, which must be oftypeDATA_TYPE.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto access column data fromcolumnName- The name of the column to accesstype- The data type of the column- Returns:
- An
ObjectVectorof 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 anObjectVectorof the data belonging to the specified column, which must be oftypeDATA_TYPE.See
class-level documentationfor more details on recommended usage and safety.- Parameters:
table- TheTableto 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 iftableisrefreshing, and only defined during theUpdatingphase of a cycle that isn't the instantiation cycle oftable.- Returns:
- An
ObjectVectorof the data belonging to the specified column
-