Class BasicFilterParser<T>

  • All Implemented Interfaces:
    FilterParser<T>

    public class BasicFilterParser<T>
    extends java.lang.Object
    implements FilterParser<T>
    A FilterParser that generates a compound predicate from the filter text. The filter text may contain terms separated by logical operators. The following logical operators are supported. The operators are listed in the order of precedence (highest first).
    • grouping: ()
    • not: !
    • and: &
    • or: │
    Note: This class is not thread safe. It is intended for use on the Swing event thread.
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicFilterParser​(java.util.function.Function<java.lang.String,​java.util.function.Predicate<T>> predicateFactory)
      Construct a parser.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getTerms()
      Get the individual terms of the parsed predicate.
      java.util.function.Predicate<T> parse​(FilterSource source)
      Parse the filter text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicFilterParser

        public BasicFilterParser​(java.util.function.Function<java.lang.String,​java.util.function.Predicate<T>> predicateFactory)
        Construct a parser.
        Parameters:
        predicateFactory - a function for creating a predicate for a single term
    • Method Detail

      • parse

        public java.util.function.Predicate<T> parse​(FilterSource source)
        Description copied from interface: FilterParser
        Parse the filter text.
        Specified by:
        parse in interface FilterParser<T>
        Returns:
        a predicate matching the parsed filter text
      • getTerms

        public java.util.List<java.lang.String> getTerms()
        Description copied from interface: FilterParser
        Get the individual terms of the parsed predicate.
        Specified by:
        getTerms in interface FilterParser<T>