Class TableMapImpl

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, Deflatable<TableMap>, LivenessManager, LivenessNode, LivenessReferent, DynamicNode, TableMap, TransformableTableMap, Serializable
Direct Known Subclasses:
LocalTableMap, TableMapClient

public abstract class TableMapImpl extends LivenessArtifact implements TableMap, DynamicNode
See Also:
  • Constructor Details

    • TableMapImpl

      public TableMapImpl()
  • Method Details

    • addListener

      public void addListener(TableMap.Listener listener)
      Description copied from interface: TableMap
      Add a new listener for changes to the map.
      Specified by:
      addListener in interface TableMap
      Parameters:
      listener - map change listener
    • removeListener

      public void removeListener(TableMap.Listener listener)
      Description copied from interface: TableMap
      Removes a map change listener.
      Specified by:
      removeListener in interface TableMap
      Parameters:
      listener - map change listener.
    • addKeyListener

      public void addKeyListener(TableMap.KeyListener listener)
      Description copied from interface: TableMap
      Listen to changes in the map's keys.
      Specified by:
      addKeyListener in interface TableMap
      Parameters:
      listener - key change listener
    • removeKeyListener

      public void removeKeyListener(TableMap.KeyListener listener)
      Description copied from interface: TableMap
      Removes a key change listener.
      Specified by:
      removeKeyListener in interface TableMap
      Parameters:
      listener - key change listener to remove
    • notifyListeners

      protected void notifyListeners(Object key, Table table)
      Notify TableMap.Listeners of an inserted table.
      Parameters:
      key - the newly inserted key
      table - the corresponding table
    • notifyKeyListeners

      protected void notifyKeyListeners(Object key)
      Notify TableMap.KeyListeners of an inserted key.
      Parameters:
      key - the newly inserted key
    • isRefreshing

      public boolean isRefreshing()
      Description copied from interface: DynamicNode
      Is the node updating?
      Specified by:
      isRefreshing in interface DynamicNode
      Returns:
      true if the node is updating; false otherwise.
    • setRefreshing

      public boolean setRefreshing(boolean refreshing)
      Description copied from interface: DynamicNode
      Change the node's refresh mode.
      Specified by:
      setRefreshing in interface DynamicNode
      Parameters:
      refreshing - true to cause the node to update; false otherwise.
      Returns:
      new refreshing state
    • addParentReference

      public void addParentReference(@NotNull Object parent)
      Description copied from interface: DynamicNode
      Called on a dependent node to ensure that a strong reference is maintained to any parent object that is required for the proper maintenance and functioning of the dependent. In the most common case, the parent object is a child listener to a parent node. The parent node only keeps a weak reference to its child listener, but the listener maintains a strong reference to the parent node. In this scenario, the only strong reference to the listener (and thus indirectly to the parent node itself) is the reference kept by the dependent node.
      Specified by:
      addParentReference in interface DynamicNode
      Parameters:
      parent - A parent of this node
    • destroy

      protected void destroy()
      Description copied from class: ReferenceCountedLivenessNode

      Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().

      This is intended to only ever be used as a side effect of decreasing the reference count to 0.

      Overrides:
      destroy in class ReferenceCountedLivenessNode