Interface FilterModel.VisibleItems<T>

Type Parameters:
T - the item type
All Superinterfaces:
Observable<List<T>>, Observer<List<T>>
Enclosing interface:
FilterModel<T>

public static interface FilterModel.VisibleItems<T> extends Observable<List<T>>
  • Method Details

    • predicate

      Value<Predicate<T>> predicate()
      Returns:
      the Value controlling the predicate specifying which items should be visible
    • contains

      boolean contains(T item)
      Returns true if the given item is visible
      Parameters:
      item - the item
      Returns:
      true if the item is visible
    • indexOf

      int indexOf(T item)
      Parameters:
      item - the item
      Returns:
      the index of the item in this model
    • itemAt

      T itemAt(int index)
      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

      boolean addItemsAt(int index, Collection<T> items)
      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

      Value<Comparator<T>> comparator()
      Returns:
      the Value controlling the comparator to use when sorting