Package eu.bandm.tools.paisley
Class MultiTransform<A,B>
java.lang.Object
eu.bandm.tools.paisley.Pattern<A>
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
ConstructorsModifierConstructorDescriptionprotectedMultiTransform(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.voidclose()protected voidcompileApply(CompilationContext context) protected voidcompileClose(CompilationContext context) protected voidcompileHasNext(CompilationContext context) protected voidcompileNext(CompilationContext context) protected voidcompileOpen(CompilationContext context) booleanhasNext()next()static <A,B> MultiTransform <A, B> voidMethods inherited from class eu.bandm.tools.paisley.FlatMultiTransform
compileMatch, compileMatchAgain, compileMatchNext, compileMatchNextBody, cut, match, matchAgainMethods inherited from class eu.bandm.tools.paisley.Unary
binds, clear, clone, compileClear, compileCut, getBody, isDeterministic, preserves, preserves, setBody, toStringMethods 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, once, or, orElse, orElse, repeat, some, some, some, some, someMatch, startCompile, uniquely, variable, variable
-
Constructor Details
-
MultiTransform
Creates a new pattern.
-
-
Method Details
-
of
public static <A,B> MultiTransform<A,B> of(Function<? super A, ? extends Iterable<B>> fun, Pattern<? super B> body) -
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.bodyto be matched against.
-
open
- Specified by:
openin classFlatMultiTransform<A,B>
-
close
public void close()- Specified by:
closein classFlatMultiTransform<A,B>
-
hasNext
public boolean hasNext()- Specified by:
hasNextin classFlatMultiTransform<A,B>
-
next
- Specified by:
nextin classFlatMultiTransform<A,B>
-
compileOpen
- Overrides:
compileOpenin classFlatMultiTransform<A,B>
-
compileClose
- Overrides:
compileClosein classFlatMultiTransform<A,B>
-
compileHasNext
- Overrides:
compileHasNextin classFlatMultiTransform<A,B>
-
compileNext
- Overrides:
compileNextin classFlatMultiTransform<A,B>
-
compileApply
-