public abstract class RestrictedTransform<A,B> extends Transform<A,B>
Modifier | Constructor and Description |
---|---|
protected |
RestrictedTransform(Pattern<? super B> body)
Creates a new pattern.
|
Modifier and Type | Method and Description |
---|---|
protected void |
compileIsDomain(eu.bandm.tools.paisley.CompilationContext context) |
protected void |
compileIsRange(eu.bandm.tools.paisley.CompilationContext context) |
protected void |
compileMatch(eu.bandm.tools.paisley.CompilationContext context) |
protected void |
compileMatchAgain(eu.bandm.tools.paisley.CompilationContext context) |
boolean |
isDomain(A target) |
boolean |
isRange(B transformed) |
boolean |
match(A target)
Attempts to match this pattern against a given object.
|
boolean |
matchAgain()
Attempts to re-match this pattern against a previously matched
object.
|
apply, compileApply
binds, clear, clone, compileClear, compileCut, cut, getBody, isDeterministic, preserves, preserves, setBody, toString
all, all, all, all, all, and, andThen, andThen, any, any, aside, both, clear, compareTo, compile, compileClear, compileCut, compileIsDeterministic, compileSubPattern, compileThis, compileUpTo, cut, DEBUG, either, enPassant, eq, eqNull, equal, filter, flatten, forInstancesOf, limit, main, matchOnce, matchVar, narrow, neq, neqNull, newAll, noMatch, none, or, orElse, orElse, repeat, some, some, some, some, someMatch, startCompile, test, transform, uniquely, variable, variable
public boolean match(A target)
Pattern
match
in class Pattern<A>
target
- the object to match againsttrue
if the matching is successful, false
if it fails. Which Variable
s are bound by a
successful or failed match depends.Pattern.binds(Variable)
,
Pattern.preserves(Variable, boolean)
public boolean matchAgain()
Pattern
Patterns classes that do not override this method are
deterministic. Pattern classes that overwrite this method to
provide additional matches should also override Pattern.isDeterministic()
.
matchAgain
in class Unary<B,A>
true
if the matching is successful, false
if it fails. Which Variable
s are bound by a
successful match depends. The default implementation
always returns false
.Pattern.binds(Variable)
,
Pattern.preserves(Variable, boolean)
public boolean isDomain(A target)
public boolean isRange(B transformed)
protected void compileMatch(eu.bandm.tools.paisley.CompilationContext context)
compileMatch
in class Pattern<A>
protected void compileMatchAgain(eu.bandm.tools.paisley.CompilationContext context)
compileMatchAgain
in class Pattern<A>
protected void compileIsDomain(eu.bandm.tools.paisley.CompilationContext context)
protected void compileIsRange(eu.bandm.tools.paisley.CompilationContext context)
see also the complete user documentation .