Class LiveQueryTable

All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable, LiveTable, NotificationQueue.Dependency, Deflatable<Table>, Table, LivenessManager, LivenessNode, LivenessReferent, LongSizedDataStructure, DynamicNode, DynamicTable, NotificationStepReceiver, NotificationStepSource, SystemicObject, Serializable, Runnable

public class LiveQueryTable extends QueryTable implements LiveTable
A very simple QueryTable that also implements LiveTable. Additions are added with addIndex(long) or addRange(long, long); and then become effective when the refresh() or addPendingKeys() methods are called.
See Also:
  • Constructor Details

  • Method Details

    • refresh

      public void refresh()
      Add the currently pending additions to the index and notify listeners. When creating a table you can not call refresh from your constructor, because the refresh sends a notification. Instead call addPendingKeys().
      Specified by:
      refresh in interface LiveTable
    • addPendingKeys

      public Index addPendingKeys()
      Add the currently pending additions to the index, without notification.
    • addIndex

      public void addIndex(long key)
      Add a key to the index on the next refresh.
      Parameters:
      key - the key to add
    • addRange

      public void addRange(long firstKey, long lastKey)
      Add a range of keys to the index on the next refresh.
      Parameters:
      firstKey - the first key to add, inclusive
      lastKey - the last key to add, inclusive
    • destroy

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