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:
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 theThreadedTableModel
. 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 sortedvoid
insert(ROW_OBJECT value)
Adds the new value to the data at the appropriate location based on the sortjava.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()
-
-
-
Method Detail
-
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
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 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
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 interfacejava.lang.Iterable<ROW_OBJECT>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-