Interface Extractor<A>

All Known Implementing Classes:
Theme, Variable

public interface Extractor<A>
  • Method Summary

    Modifier and Type
    Method
    Description
    default <B> Pattern<B>
    bind(Pattern<? super B> root, Pattern<? super A> sub)
    Returns a pattern that effectively substitutes a subpattern for this extractor in a given root pattern.
    default <B> List<A>
    eagerBindings(Pattern<B> root, B target)
    Returns a collection of values bound to this extractor by all matches of a patterns for a target.
     
    default <B> Iterable<A>
    lazyBindings(Pattern<B> root, B target)
     
  • Method Details

    • getValue

      A getValue()
    • eagerBindings

      default <B> List<A> eagerBindings(Pattern<B> root, B target)
      Returns a collection of values bound to this extractor by all matches of a patterns for a target.

      In contrast to lazyBindings(Pattern, Object), the alternative successful matches are exhausted before this method returns.

      Parameters:
      root - the pattern to match.
      target - the object to match against.
      Returns:
      the values bound by this extractor on all successive matching attempts of root against target, in order. The resulting List object is not shared, and may be used and modified freely by the caller.
      See Also:
    • lazyBindings

      default <B> Iterable<A> lazyBindings(Pattern<B> root, B target)
    • bind

      default <B> Pattern<B> bind(Pattern<? super B> root, Pattern<? super A> sub)
      Returns a pattern that effectively substitutes a subpattern for this extractor in a given root pattern.

      The structure of the root pattern is not analyzed. Instead, its bindings to this extractor are enumerated (as in lazyBindings(Pattern, Object)) and matched successively with the sub pattern.

      Parameters:
      root - the root pattern to substitute in. Substitution has unspecified effect if root does not bind this extractor.
      sub - the subpattern to substitute.
      See Also: