Class TableData<ROW_OBJECT>

  • Type Parameters:
    ROW_OBJECT - the row type
    All Implemented Interfaces:
    java.lang.Iterable<ROW_OBJECT>

    public class TableData<ROW_OBJECT>
    extends java.lang.Object
    implements java.lang.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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      ROW_OBJECT get​(int modelRow)  
      int hashCode()  
      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
      void insert​(ROW_OBJECT value)
      Adds the new value to the data at the appropriate location based on the sort
      java.util.Iterator<ROW_OBJECT> iterator()  
      void process​(java.util.function.BiFunction<java.util.List<ROW_OBJECT>,​TableSortingContext<ROW_OBJECT>,​java.util.List<ROW_OBJECT>> function)
      A generic method that allows clients to process the contents of this table data.
      boolean remove​(ROW_OBJECT t)  
      int size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • size

        public int size()
      • 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

        public void process​(java.util.function.BiFunction<java.util.List<ROW_OBJECT>,​TableSortingContext<ROW_OBJECT>,​java.util.List<ROW_OBJECT>> function)
        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 java.util.Iterator<ROW_OBJECT> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<ROW_OBJECT>
      • toString

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

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object