- Type Parameters:
T
- the item type
- All Superinterfaces:
Mutable<Collection<T>>
,Observable<Collection<T>>
,Observer<Collection<T>>
- All Known Subinterfaces:
FilterComboBoxModel.ComboBoxItems<T>
- Enclosing interface:
- FilterModel<T>
A
Mutable
controlling the items in a FilterModel
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds the given item to this model.boolean
addItems
(Collection<T> items) Adds the given items to the bottom of this table model.boolean
Returns true if the model contain the given item, as visible or filtered.int
count()
void
filter()
Filters the items according to the predicate specified byFilterModel.VisibleItems.predicate()
.filtered()
boolean
removeItem
(T item) Removes the given item from this modelboolean
removeItems
(Collection<T> items) Removes the given items from this table modelvisible()
Methods inherited from interface is.codion.common.observer.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, get, observer, optional, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
-
Method Details
-
addItem
Adds the given item to this model. Note that if the item does not pass theFilterModel.VisibleItems.predicate()
, it will be filtered right away.- Parameters:
item
- the item to add- Returns:
- true if the item was added to the visible items
-
addItems
Adds the given items to the bottom of this table model. Note that if an item does not pass theFilterModel.VisibleItems.predicate()
, it will be filtered right away.- Parameters:
items
- the items to add- Returns:
- true if one or more of the items was added to the visible items
-
removeItem
Removes the given item from this model- Parameters:
item
- the item to remove from the model- Returns:
- true if the item was removed from the visible items
-
removeItems
Removes the given items from this table model- Parameters:
items
- the items to remove from the model- Returns:
- true if one or more of the items were removed from the visible items
-
visible
FilterModel.VisibleItems<T> visible()- Returns:
- a
FilterModel.VisibleItems
providing access to the visible items, in the order they appear in the model
-
filtered
FilterModel.FilteredItems<T> filtered()- Returns:
- a
FilterModel.FilteredItems
providing access to the filtered items
-
contains
Returns true if the model contain the given item, as visible or filtered.- Parameters:
item
- the item- Returns:
- true if this model contains the item
-
count
int count()- Returns:
- the total number of items, visible and filtered
-
filter
void filter()Filters the items according to the predicate specified byFilterModel.VisibleItems.predicate()
. If no visible predicate is specified this method does nothing. This method does not interfere with the internal ordering of the visible items.- See Also:
-