JavaScript is disabled on your browser.
Method Summary
All Methods Instance Methods Abstract Methods
boolean
Adds the given item at the given index.
boolean
Adds the given items at the last index.
boolean
Returns true if the given item is visible
int
int
Removes from this table model the visible element whose index is between index
Removes from this table model all visible elements whose index is between fromIndex, inclusive and toIndex, exclusive
boolean
Sets the item at the given index.
void
Sorts the visible items according to
comparator()
, preserving the selection.
Methods inherited from interface is.codion.common.observer.Observable
addConsumer , addListener , addWeakConsumer , addWeakListener , get , observer , optional , removeConsumer , removeListener , removeWeakConsumer , removeWeakListener
Method Details
predicate
Returns:
the Value
controlling the predicate specifying which items should be visible
contains
Returns true if the given item is visible
Parameters:
item
- the item
Returns:
true if the item is visible
indexOf
Parameters:
item
- the item
Returns:
the index of the item in this model
itemAt
Parameters:
index
- the row index
Returns:
the item at the given index in this model
addItemAt
boolean addItemAt (int index,
T item)
Adds the given item at the given index.
Note that if the item does not pass the visible
predicate()
it is filtered right away and the method returns false.
Parameters:
index
- the index
item
- the item to add
Returns:
true if the item was added to the visible items
addItemsAt
Adds the given items at the last index.
Note that if an item does not pass the visible
predicate()
it is filtered right away.
Parameters:
index
- the index at which to add the items
items
- the items to add
Returns:
true if one or more of the items was added to the visible items
setItemAt
boolean setItemAt (int index,
T item)
Sets the item at the given index.
Note that if the item does not pass the visible
predicate()
this method has no effect.
Parameters:
index
- the index
item
- the item
Returns:
true if the item was set, false if it did not pass the visible predicate()
See Also:
removeItemAt
T removeItemAt (int index)
Removes from this table model the visible element whose index is between index
Parameters:
index
- the index of the row to be removed
Returns:
the removed item
Throws:
IndexOutOfBoundsException
- in case the index is out of bounds
removeItems
List <T > removeItems (int fromIndex,
int toIndex)
Removes from this table model all visible elements whose index is between fromIndex, inclusive and toIndex, exclusive
Parameters:
fromIndex
- index of first row to be removed
toIndex
- index after last row to be removed
Returns:
the removed items
Throws:
IndexOutOfBoundsException
- in case the indexes are out of bounds
count
int count ()
Returns:
the number of visible items
sort
void sort ()
Sorts the visible items according to
comparator()
, preserving the selection.
Calling this method when no comparator is specified has no effect.
See Also:
comparator
Returns:
the Value
controlling the comparator to use when sorting