Package docking.widgets.table.threaded
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>
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
Modifier and TypeMethodDescriptionfinal booleanget(int modelRow) final inthashCode()intUses the current sort to perform a fast lookup of the given item in the given list when sorted; a brute-force lookup when not sortedvoidinsert(ROW_OBJECT value) Adds the newvalueto the data at the appropriate location based on the sortiterator()voidprocess(BiFunction<List<ROW_OBJECT>, TableSortingContext<ROW_OBJECT>, List<ROW_OBJECT>> function) A generic method that allows clients to process the contents of this table data.booleanremove(ROW_OBJECT t) intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
size
public int size() -
get
-
indexOf
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
-
process
public void process(BiFunction<List<ROW_OBJECT>, TableSortingContext<ROW_OBJECT>, 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 aTableUpdateJobor 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
Adds the newvalueto the data at the appropriate location based on the sort- Parameters:
value- the row Object to insert
-
iterator
- Specified by:
iteratorin interfaceIterable<ROW_OBJECT>
-
toString
-
equals
-
hashCode
public final int hashCode()
-