Class Evaluator

    • Constructor Detail

      • Evaluator

        protected Evaluator()
    • Method Detail

      • asPredicate

        public java.util.function.Predicate<Element> asPredicate​(Element root)
        Provides a Predicate for this Evaluator, matching the test Element.
        Parameters:
        root - the root Element, for match evaluation
        Returns:
        a predicate that accepts an Element to test for matches with this Evaluator
        Since:
        1.17.1
      • matches

        public abstract boolean matches​(Element root,
                                        Element element)
        Test if the element meets the evaluator's requirements.
        Parameters:
        root - Root of the matching subtree
        element - tested element
        Returns:
        Returns true if the requirements are met or false otherwise
      • reset

        protected void reset()
        Reset any internal state in this Evaluator before executing a new Collector evaluation.
      • cost

        protected int cost()
        A relative evaluator cost function. During evaluation, Evaluators are sorted by ascending cost as an optimization.
        Returns:
        the relative cost of this Evaluator