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:
  • Field Details

  • Constructor Details

    • SwappableTable

      public SwappableTable(@NotNull TableMapHandle tableMapHandle)
      Creates a SwappableTable instance with the tableHandle.
      Parameters:
      tableMapHandle - holds the table
  • Method Details

    • getTableMapHandle

      public TableMapHandle getTableMapHandle()
      Gets the TableHandle for this SwappableTable.
      Returns:
      this SwappableTable's TableHandle
    • addColumn

      public abstract void addColumn(String column)
      Adds a column to the underlying table structures.
      Parameters:
      column - column
    • getTableDefinition

      public TableDefinition 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

      protected abstract boolean updateState(KEY_TYPE key, VALUE_TYPE value)
      Update the state for a given column selection.
      Parameters:
      key - key for table calculation
      value - value for table calculation
      Returns:
      whether this table should recompute
    • computeRemoteTable

      protected abstract Table computeRemoteTable()
      Computes the remote table.
      Returns:
      computed remote table
    • tableCalculationChanged

      public boolean tableCalculationChanged(KEY_TYPE key, VALUE_TYPE value)
      Updates the local table with the specified calculation.
      Parameters:
      key - key
      value - value
      Returns:
      true if the table calculation changed
    • invokeRecompute

      protected void invokeRecompute()
    • getFriendlyName

      protected abstract String getFriendlyName()
      Get a readable name for use with threads/logs etc.
      Returns:
      a name to use
    • localRecomputeComplete

      protected abstract void localRecomputeComplete()
    • setManager

      public void setManager(FigureTableSnapshotManager manager)
    • getManager

      protected FigureTableSnapshotManager getManager()
    • getReplicatedTableSnapshot

      public TableSnapshot getReplicatedTableSnapshot()
    • freezeSnapshots

      public void freezeSnapshots()
    • thawSnapshots

      public boolean thawSnapshots()
    • getSnapshotData

      public Map<String,Object> getSnapshotData()
    • addLocalTableUpdateListener

      public Table addLocalTableUpdateListener(SwappableTable.LocalTableUpdateListener listener)
      Adds a listener to the update list. The listener will be notified of local table updates.
      Parameters:
      listener - listener
      Returns:
      current local table
    • removeLocalTableUpdateListener

      public void removeLocalTableUpdateListener(SwappableTable.LocalTableUpdateListener listener)
      Removes a listener to the update list.
      Parameters:
      listener - listener
    • addDataChangeListener

      public void addDataChangeListener(DataChangeListener listener)
      Adds a listener to the update list. The listener will be notified of data changes.
      Parameters:
      listener - listener
    • unsubscribeLocalTable

      public void unsubscribeLocalTable()
    • maybeInitializeTransient

      protected void maybeInitializeTransient()
    • beginBatchUpdate

      protected void beginBatchUpdate()
    • endBatchUpdate

      protected void endBatchUpdate()