Package eu.bandm.tools.paisley
Interface Extractor<A>
public interface Extractor<A>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <B> Pattern<B> Returns a pattern that effectively substitutes a subpattern for this extractor in a given root pattern.eagerBindings(Pattern<B> root, B target) Returns a collection of values bound to this extractor by all matches of a patterns for a target.getValue()lazyBindings(Pattern<B> root, B target)
-
Method Details
-
getValue
A getValue() -
eagerBindings
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
rootagainsttarget, in order. The resultingListobject is not shared, and may be used and modified freely by the caller. - See Also:
-
lazyBindings
-
bind
Returns a pattern that effectively substitutes a subpattern for this extractor in a given root pattern.The structure of the
rootpattern is not analyzed. Instead, its bindings to this extractor are enumerated (as inlazyBindings(Pattern, Object)) and matched successively with thesubpattern.- Parameters:
root- the root pattern to substitute in. Substitution has unspecified effect ifrootdoes not bind this extractor.sub- the subpattern to substitute.- See Also:
-