Class StructuralEvaluator.ImmediateParentRun

  • Enclosing class:
    StructuralEvaluator

    static class StructuralEvaluator.ImmediateParentRun
    extends Evaluator
    Holds a list of evaluators for one > two > three immediate parent matches, and the final direct evaluator under test. To match, these are effectively ANDed together, starting from the last, matching up to the first.
    • Field Detail

      • evaluators

        final java.util.ArrayList<Evaluator> evaluators
      • cost

        int cost
    • Constructor Detail

      • ImmediateParentRun

        public ImmediateParentRun​(Evaluator evaluator)
    • Method Detail

      • matches

        public boolean matches​(Element root,
                               Element element)
        Description copied from class: Evaluator
        Test if the element meets the evaluator's requirements.
        Specified by:
        matches in class Evaluator
        Parameters:
        root - Root of the matching subtree
        element - tested element
        Returns:
        Returns true if the requirements are met or false otherwise
      • cost

        protected int cost()
        Description copied from class: Evaluator
        A relative evaluator cost function. During evaluation, Evaluators are sorted by ascending cost as an optimization.
        Overrides:
        cost in class Evaluator
        Returns:
        the relative cost of this Evaluator
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object