Package io.deephaven.engine.table
Class ModifiedColumnSet
java.lang.Object
io.deephaven.engine.table.ModifiedColumnSet
Data structure to represent a subset of columns, used for propagating modifications via
TableUpdate
instances.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A helper utility that simplifies propagating modified columns to a child table. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ModifiedColumnSet
A static 'special' ModifiedColumnSet that pretends all columns are dirty.static final ModifiedColumnSet
A static 'special' ModifiedColumnSet that pretends no columns are dirty. -
Constructor Summary
ConstructorDescriptionCreate a new ModifiedColumnSet that shares all immutable state with the provided MCS.ModifiedColumnSet
(Map<String, ColumnSource<?>> columns) Create an empty ModifiedColumnSet from the provided Column Source Map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the current dirty column state.void
clearAll
(ModifiedColumnSet columnSet) Marks all columns in the provided column set in this set as clean.void
Turns off all bits for these columns.boolean
containsAll
(ModifiedColumnSet columnSet) Check whether or not all columns are currently marked as dirty.boolean
containsAny
(ModifiedColumnSet columnSet) Check whether or not any columns are currently marked as dirty.copy()
Create an exact copy of this ModifiedColumnSet.String[]
boolean
empty()
boolean
boolean
isCompatibleWith
(ModifiedColumnSet columnSet) newIdentityTransformer
(Map<String, ? extends ColumnSource<?>> newColumns) Create a transformer that uses an identity mapping from one ColumnSourceMap to another.newTransformer
(String[] columnNames, ModifiedColumnSet[] columnSets) Create a transformer that is compatible with the class of ModifiedColumnSets that share a ColumnSourceMap.boolean
nonempty()
int
boolean
requiresTransformer
(ModifiedColumnSet columnSet) This method is used to determine whether or not a dependent requires a transformer to propagate dirty columns from its parent.void
setAll
(ModifiedColumnSet columnSet) Marks all columns in the provided column set in this set as dirty.void
Turns on all bits for these columns.void
Sets all columns dirty.void
setColumnsInIndexRange
(int columnStart, int columnEndExclusive) Marks specifically a range of adjacent columns.void
setColumnWithIndex
(int columnIndex) Marks specifically the column with the given index as dirty.int
size()
toString()
toString
(int maxColumns)
-
Field Details
-
ALL
A static 'special' ModifiedColumnSet that pretends all columns are dirty. Useful for backwards compatibility and convenience. -
EMPTY
A static 'special' ModifiedColumnSet that pretends no columns are dirty.
-
-
Constructor Details
-
ModifiedColumnSet
Create an empty ModifiedColumnSet from the provided Column Source Map. Note: prefer to use the copy constructor on future objects that share this CSM to minimize duplicating state.- Parameters:
columns
- The column source map this ModifiedColumnSet will use.
-
ModifiedColumnSet
Create a new ModifiedColumnSet that shares all immutable state with the provided MCS. The dirty set will initially be empty.- Parameters:
other
- The ModifiedColumnSet to borrow immutable state from.
-
-
Method Details
-
extractAsBitSet
-
newTransformer
public ModifiedColumnSet.Transformer newTransformer(String[] columnNames, ModifiedColumnSet[] columnSets) Create a transformer that is compatible with the class of ModifiedColumnSets that share a ColumnSourceMap.- Parameters:
columnNames
- input columns to check for dirtinesscolumnSets
- output columns to mark dirty when input column is dirty- Returns:
- a new Transformer instance
-
newIdentityTransformer
public ModifiedColumnSet.Transformer newIdentityTransformer(Map<String, ? extends ColumnSource<?>> newColumns) Create a transformer that uses an identity mapping from one ColumnSourceMap to another. The two CSM's must have equivalent column names and column ordering.- Parameters:
newColumns
- the column source map for result table- Returns:
- a simple Transformer that makes a cheap, but CSM compatible copy
-
isCompatibleWith
- Returns:
- whether or not this modified column set is compatible with the provided set
-
requiresTransformer
This method is used to determine whether or not a dependent requires a transformer to propagate dirty columns from its parent. If no transformer is required then it is acceptable to reuse any column set provided by the parent. Note this is intended to be determined during initialization and never during an update cycle. It is illegal to use the specialized ModifiedColumnSet.EMPTY / ModifiedColumnSet.ALL as their innards do not represent any table.- Parameters:
columnSet
- the column set for the dependent table- Returns:
- whether or not this modified column set must use a Transformer to propagate modified columns
-
copy
Create an exact copy of this ModifiedColumnSet.- Returns:
- a copy with identical state including dirty bits
-
clear
public void clear()Reset the current dirty column state. -
setAllDirty
public void setAllDirty()Sets all columns dirty. -
size
public int size()- Returns:
- the number of dirty columns
-
empty
public boolean empty()- Returns:
- whether or not this set is empty
-
nonempty
public boolean nonempty()- Returns:
- whether or not this set is non-empty
-
numColumns
public int numColumns()- Returns:
- the number of columns in this set
- Throws:
UnsupportedOperationException
- onALL
andEMPTY
-
dirtyColumnNames
- Returns:
- the names of the dirty columns in this set
-
setAll
Turns on all bits for these columns. Use this method to prepare pre-computed ModifiedColumnSets.- Parameters:
columnNames
- the columns which need to be marked dirty
-
setAll
Marks all columns in the provided column set in this set as dirty.- Parameters:
columnSet
- the set of columns to mark dirty
-
setColumnWithIndex
public void setColumnWithIndex(int columnIndex) Marks specifically the column with the given index as dirty.- Parameters:
columnIndex
- column index to mark dirty
-
setColumnsInIndexRange
public void setColumnsInIndexRange(int columnStart, int columnEndExclusive) Marks specifically a range of adjacent columns. Start is inclusive, end is exclusive; like the BitSet API.- Parameters:
columnStart
- start column index to mark dirtycolumnEndExclusive
- end column index to mark dirty
-
clearAll
Turns off all bits for these columns. Use this method to prepare pre-computed ModifiedColumnSets.- Parameters:
columnNames
- the columns which need to be marked clean
-
clearAll
Marks all columns in the provided column set in this set as clean.- Parameters:
columnSet
- the set of columns to mark clean
-
containsAny
Check whether or not any columns are currently marked as dirty.- Parameters:
columnSet
- the columns to check- Returns:
- true iff any column is dirty
-
containsAll
Check whether or not all columns are currently marked as dirty.- Parameters:
columnSet
- the columns to check- Returns:
- true iff all columns match dirtiness
-
equals
-
toDebugString
-
toString
-
toString
-