Interface FilteredModel<T>

    • Method Detail

      • getIncludeCondition

        Predicate<T> getIncludeCondition()
        Returns the include condition used by this model, null if no include condition has been set.
        Returns:
        the include condition
      • setIncludeCondition

        void setIncludeCondition​(Predicate<T> includeCondition)
        Sets the include condition and filters the model
        Parameters:
        includeCondition - the Predicate to use when filtering, null if no filtering should be performed
      • visibleItems

        List<T> visibleItems()
        Returns:
        an unmodifiable view of the visible items
      • filteredItems

        List<T> filteredItems()
        Returns:
        an unmodifiable view of the filtered items
      • visibleItemCount

        int visibleItemCount()
        Returns:
        the number of currently visible items
      • filteredItemCount

        int filteredItemCount()
        Returns:
        the number of currently filtered items
      • containsItem

        boolean containsItem​(T item)
        Returns true if this model contains the given item, visible or filtered.
        Parameters:
        item - the item
        Returns:
        true if this model contains the item
      • isVisible

        boolean isVisible​(T item)
        Returns true if this model contains the given item, and it is visible, that is, not filtered
        Parameters:
        item - the item
        Returns:
        true if the given item is visible
      • isFiltered

        boolean isFiltered​(T item)
        Returns true if this model contains the given item, and it is filtered, that is, is not visible
        Parameters:
        item - the item
        Returns:
        true if the given item is filtered
      • refreshingObserver

        StateObserver refreshingObserver()
        Returns:
        an observer active while a refresh is in progress
      • addRefreshListener

        void addRefreshListener​(EventListener listener)
        Parameters:
        listener - a listener to be notified each time this model has been successfully refreshed
        See Also:
        refresh()
      • removeRefreshListener

        void removeRefreshListener​(EventListener listener)
        Parameters:
        listener - the listener to remove
        See Also:
        refresh()
      • addRefreshFailedListener

        void addRefreshFailedListener​(EventDataListener<Throwable> listener)
        Parameters:
        listener - a listener to be notified each time an asynchronous refresh has failed
        See Also:
        refresh()
      • removeRefreshFailedListener

        void removeRefreshFailedListener​(EventDataListener<Throwable> listener)
        Parameters:
        listener - the listener to remove
      • addFilterListener

        void addFilterListener​(EventListener listener)
        Parameters:
        listener - a listener notified each time this model is filtered
      • removeFilterListener

        void removeFilterListener​(EventListener listener)
        Parameters:
        listener - the listener to remove