Class SwappableTable<KEY_TYPE,VALUE_TYPE>
java.lang.Object
com.illumon.iris.db.plot.util.tables.SwappableTable<KEY_TYPE,VALUE_TYPE>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SwappableTableOneClickAbstract
Holds a handle on a table that may get swapped out for another table.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListens for when the table gets swapped out. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSwappableTable(TableMapHandle tableMapHandle) Creates a SwappableTable instance with thetableHandle. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdds a column to the underlying table structures.voidaddDataChangeListener(DataChangeListener listener) Adds a listener to the update list.Adds a listener to the update list.protected voidprotected abstract TableComputes the remote table.protected voidvoidprotected abstract StringGet a readable name for use with threads/logs etc.protected FigureTableSnapshotManagerGets the signature (columns and types) of the table, \even if the data is transformed.Gets theTableHandlefor this SwappableTable.protected voidprotected abstract voidprotected voidvoidRemoves a listener to the update list.voidsetManager(FigureTableSnapshotManager manager) booleantableCalculationChanged(KEY_TYPE key, VALUE_TYPE value) Updates the local table with the specified calculation.booleanvoidprotected abstract booleanupdateState(KEY_TYPE key, VALUE_TYPE value) Update the state for a given column selection.
-
Field Details
-
tableMapHandle
-
-
Constructor Details
-
SwappableTable
Creates a SwappableTable instance with thetableHandle.- Parameters:
tableMapHandle- holds the table
-
-
Method Details
-
getTableMapHandle
Gets theTableHandlefor this SwappableTable.- Returns:
- this SwappableTable's
TableHandle
-
addColumn
Adds a column to the underlying table structures.- Parameters:
column- column
-
getTableDefinition
Gets the signature (columns and types) of the table, \even if the data is transformed.- Returns:
- table with the columns and types of the final table
-
updateState
Update the state for a given column selection.- Parameters:
key- key for table calculationvalue- value for table calculation- Returns:
- whether this table should recompute
-
computeRemoteTable
Computes the remote table.- Returns:
- computed remote table
-
tableCalculationChanged
Updates the local table with the specified calculation.- Parameters:
key- keyvalue- value- Returns:
- true if the table calculation changed
-
invokeRecompute
protected void invokeRecompute() -
getFriendlyName
Get a readable name for use with threads/logs etc.- Returns:
- a name to use
-
localRecomputeComplete
protected abstract void localRecomputeComplete() -
setManager
-
getManager
-
getReplicatedTableSnapshot
-
freezeSnapshots
public void freezeSnapshots() -
thawSnapshots
public boolean thawSnapshots() -
getSnapshotData
-
addLocalTableUpdateListener
Adds a listener to the update list. Thelistenerwill be notified of local table updates.- Parameters:
listener- listener- Returns:
- current local table
-
removeLocalTableUpdateListener
Removes a listener to the update list.- Parameters:
listener- listener
-
addDataChangeListener
Adds a listener to the update list. Thelistenerwill be notified of data changes.- Parameters:
listener- listener
-
unsubscribeLocalTable
public void unsubscribeLocalTable() -
maybeInitializeTransient
protected void maybeInitializeTransient() -
beginBatchUpdate
protected void beginBatchUpdate() -
endBatchUpdate
protected void endBatchUpdate()
-