Class DescendantsSelector

    • Method Detail

      • then

        public Selector then()
        Description copied from class: Selector
        Returns the Selector that this Selector uses to match sub-selections.
        Specified by:
        then in class Selector
      • forSelected

        public <T> T forSelected​(Interpreter interpreter,
                                 Selectee<T> callback)
        Invokes then.forSelected() against the Interpreter containing each child, then moves onto each descendant.
        Specified by:
        forSelected in class Selector
        Returns:
        the result of executing callback from the context of the last Selector in the chain formed by Selector then fields.
      • andThen

        public Selector andThen​(Selector then)
        Description copied from class: Selector
        The means to chain Selectors. By intention, this is NOT a strict functional composition: for two Selectors s1 and s2, s1.andThen(s2) DOES NOT NECESSARILY return a new Selector s3 such that s3.evaluate(args) is equivalent to s2.evaluate(s1.evaluate(args)).

        The reason for this is that for Selectors like ChildrenSelector that yield (logical) collections, we wish to invoke the next Selector, say a GetSelector, against every result. Under strict functional rules, ChildrenSelector.andThen(someGetSelector).evaluate(args) would instead return at most one defined value regardless of the number of children.

        Specified by:
        andThen in class Selector
      • typeOrder

        public int typeOrder()
        Description copied from class: Item
        Returns the heterogeneous sort order of this Item. Used to impose a total order on the set of all items. When comparing two items of different types, the items order according to their typeOrder.
        Specified by:
        typeOrder in class Item
      • equals

        public boolean equals​(Object other)
        Specified by:
        equals in class Item
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in class Item