Package eu.bandm.tools.paisley
Class MultiTransform<A,B>
java.lang.Object
eu.bandm.tools.paisley.Pattern<B>
eu.bandm.tools.paisley.Unary<B,A>
eu.bandm.tools.paisley.FlatMultiTransform<A,B>
eu.bandm.tools.paisley.MultiTransform<A,B>
- Type Parameters:
A
- the target type of the containing patternB
- the target type of the contained subpattern
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
Variable.Plus
Abstract base class for patterns that delegate transformed targets
to a subpattern.
Subclasses must implement the apply(A)
method.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.paisley.Pattern
Pattern.Either<A>
-
Field Summary
Fields inherited from class eu.bandm.tools.paisley.Pattern
_left_matched, _target_save, none
-
Constructor Summary
ModifierConstructorDescriptionprotected
MultiTransform
(Pattern<? super B> body) Creates a new pattern. -
Method Summary
Modifier and TypeMethodDescriptionTransforms a target to be matched into an enumeration of targets for the subpattern.void
close()
protected void
compileApply
(CompilationContext context) protected void
compileClose
(CompilationContext context) protected void
compileHasNext
(CompilationContext context) protected void
compileNext
(CompilationContext context) protected void
compileOpen
(CompilationContext context) boolean
hasNext()
next()
void
Methods inherited from class eu.bandm.tools.paisley.FlatMultiTransform
compileMatch, compileMatchAgain, compileMatchNext, compileMatchNextBody, cut, match, matchAgain
Methods inherited from class eu.bandm.tools.paisley.Unary
binds, clear, clone, compileClear, compileCut, getBody, isDeterministic, preserves, preserves, setBody, toString
Methods inherited from class eu.bandm.tools.paisley.Pattern
all, all, all, all, all, and, andThen, andThen, any, aside, both, clear, compile, compileClear, compileCut, compileIsDeterministic, compileSubPattern, compileThis, compileUpTo, cut, DEBUG, either, enPassant, flatten, limit, main, matchOnce, matchVar, narrow, newAll, noMatch, none, of, or, orElse, orElse, repeat, some, some, some, some, someMatch, startCompile, uniquely, variable, variable
-
Constructor Details
-
MultiTransform
Creates a new pattern.
-
-
Method Details
-
apply
Transforms a target to be matched into an enumeration of targets for the subpattern.- Parameters:
target
- the target for this pattern to be matched against.- Returns:
- an enumeration of targets (possibly empty) for
Unary.body
to be matched against.
-
open
- Specified by:
open
in classFlatMultiTransform<A,
B>
-
close
public void close()- Specified by:
close
in classFlatMultiTransform<A,
B>
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in classFlatMultiTransform<A,
B>
-
next
- Specified by:
next
in classFlatMultiTransform<A,
B>
-
compileOpen
- Overrides:
compileOpen
in classFlatMultiTransform<A,
B>
-
compileClose
- Overrides:
compileClose
in classFlatMultiTransform<A,
B>
-
compileHasNext
- Overrides:
compileHasNext
in classFlatMultiTransform<A,
B>
-
compileNext
- Overrides:
compileNext
in classFlatMultiTransform<A,
B>
-
compileApply
-