Package eu.bandm.tools.paisley
Class Theme<A,B>
java.lang.Object
eu.bandm.tools.paisley.AbstractPattern<B>
eu.bandm.tools.paisley.Unary<B,B>
eu.bandm.tools.paisley.Proxy<B>
eu.bandm.tools.paisley.Theme<A,B>
- Type Parameters:
A- the subtarget type of objects to match the argument variable againstB- the target type of objects to match the entire pattern against
- All Implemented Interfaces:
Extractor<A>,Pattern<B>,Serializable,Cloneable
@Generated(generator="eu.bandm.tools.expander",
version="1.3.1",
timestamp="2026-02-18T13:05:48")
public class Theme<A,B>
extends Proxy<B>
implements Extractor<A>
Pattern with a distinguished argument variable.
This class provides the simplest patterns that can be derived from a
Motif, by filling the hole with a variable.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioneagerBindings(B target) Finds all values bound by this pattern for a given target.Returns the argument variable.getValue()Returns the extracted data value.lambda()Converts this pattern into a motif.lazyBindings(B target) Finds all values bound by this pattern for a given target.Methods inherited from class eu.bandm.tools.paisley.Unary
binds, clear, cut, fork, getBody, isDeterministic, matchAgain, preserves, preserves, setBodyMethods inherited from class eu.bandm.tools.paisley.AbstractPattern
cloneMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.bandm.tools.paisley.Extractor
bind, eagerBindings, lazyBindings, stream
-
Constructor Details
-
Theme
Creates a new instance.- Parameters:
body- the main pattern, which should bind the argument variablearg- the argument variable- Throws:
NullPointerException- ifbodyorargis null
-
-
Method Details
-
getArgument
Returns the argument variable.- Returns:
- the argument variable
-
getValue
Returns the extracted data value.The result is unspecified if the pattern viewed by this extractor is not in the state after a successful match.
-
lambda
Converts this pattern into a motif.- Returns:
- a motif that has the occurrences of the argument variable as the hole
- See Also:
-
eagerBindings
Finds all values bound by this pattern for a given target.In contrast to
lazyBindings(B), the alternative successful matches are are exhausted before this method returns.- Parameters:
target- the object to match against- Returns:
- the values bound by this extractor on all successive matching
attempts of
rootagainsttarget, in order. - See Also:
-
lazyBindings
Finds all values bound by this pattern for a given target.In contrast to
eagerBindings(B), the alternative successful matches are effected lazily on demand.- Parameters:
target- the object to match against- Returns:
- the values bound by this extractor on all successive matching
attempts of
rootagainsttarget, in order. - See Also:
-