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 boolean
get
(int modelRow) final int
hashCode()
int
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 sortedvoid
insert
(ROW_OBJECT value) Adds the new value to the data at the appropriate location based on the sortiterator()
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.boolean
remove
(ROW_OBJECT t) int
size()
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 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 aTableUpdateJob
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
Adds the new value to the data at the appropriate location based on the sort- Parameters:
value
- the row Object to insert
-
iterator
- Specified by:
iterator
in interfaceIterable<ROW_OBJECT>
-
toString
-
equals
-
hashCode
public final int hashCode()
-