Class PredicateTreeFilter<T>

  • Type Parameters:
    M - the type of the input to the predicate

    public class PredicateTreeFilter<T>
    extends TreeItemFilter
    Keep only elements that conform to the predicate
    See Also:
    TreeItemFilter
    • Constructor Detail

      • PredicateTreeFilter

        public PredicateTreeFilter​(Predicate<T> predicate)
        Create a instance of PredicateTreeFilter with given predicate
        Parameters:
        predicate - the filtering predicate function, cannot be null
    • Method Detail

      • keep

        public boolean keep​(Object element)
        Specified by:
        keep in class TreeItemFilter
        Returns:
        true to keep an element, false to filter it out.