Package io.deephaven.engine.rowset
Class RowSetFactory
java.lang.Object
io.deephaven.engine.rowset.RowSetFactory
Repository of factory methods for constructing
row sets
.-
Method Summary
Modifier and TypeMethodDescriptionstatic RowSetBuilderRandom
static RowSetBuilderSequential
static WritableRowSet
empty()
Get an emptyWritableRowSet
.static WritableRowSet
flat
(long size) static WritableRowSet
fromKeys
(long rowKey) Produce aWritableRowSet
containing a single row key.static WritableRowSet
fromKeys
(long... rowKeys) Get aWritableRowSet
containing the specified row keys.static WritableRowSet
fromRange
(long firstRowKey, long lastRowKey) Create aWritableRowSet
containing the continuous range [firstRowKey, lastRowKey].static WritableRowSet
unionInsert
(Collection<RowSet> rowSets) Constructs a new combinedWritableRowSet
from the union ofrowSets
.
-
Method Details
-
empty
Get an emptyWritableRowSet
.- Returns:
- A new
WritableRowSet
containing no rows
-
fromKeys
Get aWritableRowSet
containing the specified row keys. Row keys must be nonnegative numbers.- Parameters:
rowKeys
- The row keys to include- Returns:
- A new
WritableRowSet
containing the specified row keys
-
fromKeys
Produce aWritableRowSet
containing a single row key. Row keys must be nonnegative numbers.- Parameters:
rowKey
- The row key to include- Returns:
- A new
WritableRowSet
containing the specified row key
-
fromRange
Create aWritableRowSet
containing the continuous range [firstRowKey, lastRowKey].- Parameters:
firstRowKey
- The first row key in the continuous rangelastRowKey
- The last row key in the continuous range- Returns:
- A new
WritableRowSet
containing the specified row key range
-
flat
- Parameters:
size
- The size of theWritableRowSet
to create- Returns:
- A flat
WritableRowSet
containing the row key range[0, size)
or anempty row set
if thesize <= 0
-
builderRandom
- Returns:
- A
RowSetBuilderRandom
suitable for inserting row keys and row key ranges in no particular order
-
builderSequential
- Returns:
- A
RowSetBuilderRandom
optimized for inserting row keys and row key ranges sequentially in order
-
unionInsert
Constructs a new combinedWritableRowSet
from the union ofrowSets
.When considering the
RowSet.isNonempty()
elements, if none exist,empty()
will be returned; if only one exist,RowSet.copy()
will be returned; otherwise, a new row set will be returned based on theinsertion
of all the row sets.This method may perform best when the
rowSets
are ordered and non-overlapping.- Parameters:
rowSets
- the input row sets- Returns:
- the new row set
-