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
public abstract class SwappableTable<KEY_TYPE,VALUE_TYPE> extends Object implements Serializable
Holds a handle on a table that may get swapped out for another table.
- See Also:
- Serialized Form
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceSwappableTable.LocalTableUpdateListenerListens for when the table gets swapped out.
- 
Field SummaryFields Modifier and Type Field Description protected TableMapHandletableMapHandle
- 
Constructor SummaryConstructors Constructor Description SwappableTable(TableMapHandle tableMapHandle)Creates a SwappableTable instance with thetableHandle.
- 
Method SummaryModifier and Type Method Description abstract voidaddColumn(String column)Adds a column to the underlying table structures.voidaddDataChangeListener(DataChangeListener listener)Adds a listener to the update list.TableaddLocalTableUpdateListener(SwappableTable.LocalTableUpdateListener listener)Adds a listener to the update list.protected voidbeginBatchUpdate()protected abstract TablecomputeRemoteTable()Computes the remote table.protected voidendBatchUpdate()voidfreezeSnapshots()protected abstract StringgetFriendlyName()Get a readable name for use with threads/logs etc.protected FigureTableSnapshotManagergetManager()TableSnapshotgetReplicatedTableSnapshot()Map<String,Object>getSnapshotData()TableDefinitiongetTableDefinition()Gets the signature (columns and types) of the table, \even if the data is transformed.TableMapHandlegetTableMapHandle()Gets theTableHandlefor this SwappableTable.protected voidinvokeRecompute()protected abstract voidlocalRecomputeComplete()protected voidmaybeInitializeTransient()voidremoveLocalTableUpdateListener(SwappableTable.LocalTableUpdateListener listener)Removes a listener to the update list.voidsetManager(FigureTableSnapshotManager manager)booleantableCalculationChanged(KEY_TYPE key, VALUE_TYPE value)Updates the local table with the specified calculation.booleanthawSnapshots()voidunsubscribeLocalTable()protected abstract booleanupdateState(KEY_TYPE key, VALUE_TYPE value)Update the state for a given column selection.
- 
Field Details
- 
Constructor Details- 
SwappableTableCreates a SwappableTable instance with thetableHandle.- Parameters:
- tableMapHandle- holds the table
 
 
- 
- 
Method Details- 
getTableMapHandleGets theTableHandlefor this SwappableTable.- Returns:
- this SwappableTable's TableHandle
 
- 
addColumnAdds a column to the underlying table structures.- Parameters:
- column- column
 
- 
getTableDefinitionGets 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
 
- 
updateStateUpdate the state for a given column selection.- Parameters:
- key- key for table calculation
- value- value for table calculation
- Returns:
- whether this table should recompute
 
- 
computeRemoteTableComputes the remote table.- Returns:
- computed remote table
 
- 
tableCalculationChangedUpdates the local table with the specified calculation.- Parameters:
- key- key
- value- value
- Returns:
- true if the table calculation changed
 
- 
invokeRecomputeprotected void invokeRecompute()
- 
getFriendlyNameGet a readable name for use with threads/logs etc.- Returns:
- a name to use
 
- 
localRecomputeCompleteprotected abstract void localRecomputeComplete()
- 
setManager
- 
getManager
- 
getReplicatedTableSnapshot
- 
freezeSnapshotspublic void freezeSnapshots()
- 
thawSnapshotspublic boolean thawSnapshots()
- 
getSnapshotData
- 
addLocalTableUpdateListenerAdds a listener to the update list. Thelistenerwill be notified of local table updates.- Parameters:
- listener- listener
- Returns:
- current local table
 
- 
removeLocalTableUpdateListenerRemoves a listener to the update list.- Parameters:
- listener- listener
 
- 
addDataChangeListenerAdds a listener to the update list. Thelistenerwill be notified of data changes.- Parameters:
- listener- listener
 
- 
unsubscribeLocalTablepublic void unsubscribeLocalTable()
- 
maybeInitializeTransientprotected void maybeInitializeTransient()
- 
beginBatchUpdateprotected void beginBatchUpdate()
- 
endBatchUpdateprotected void endBatchUpdate()
 
-