Class TableData<ROW_OBJECT>

java.lang.Object
docking.widgets.table.threaded.TableData<ROW_OBJECT>
Type Parameters:
ROW_OBJECT - the row type
All Implemented Interfaces:
Iterable<ROW_OBJECT>

public class TableData<ROW_OBJECT> extends Object implements Iterable<ROW_OBJECT>
A concept that represents the data used by the ThreadedTableModel. This class encapsulates the actual data, along with any filter applied, any sort applied, along with some convenience methods for performing operations on this group of data.
  • Method Details

    • size

      public int size()
    • get

      public ROW_OBJECT get(int modelRow)
    • indexOf

      public int indexOf(ROW_OBJECT t)
      Uses the current sort to perform a fast lookup of the given item in the given list when sorted; a brute-force lookup when not sorted
      Parameters:
      t - the item
      Returns:
      the index
    • remove

      public boolean remove(ROW_OBJECT t)
    • process

      A generic method that allows clients to process the contents of this table data. This method is not synchronized and should only be called from a TableUpdateJob or one of its callbacks.

      Note: this method will do nothing if the data is not sorted.

      Parameters:
      function - the consumer of the data and the current sort context
    • insert

      public void insert(ROW_OBJECT value)
      Adds the new value to the data at the appropriate location based on the sort
      Parameters:
      value - the row Object to insert
    • iterator

      public Iterator<ROW_OBJECT> iterator()
      Specified by:
      iterator in interface Iterable<ROW_OBJECT>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object