T - Variable typeR - Return typeV - Aggregate Variable type holderpublic static class ComprehensionsModule.ComprehensionData<T,R>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
T |
$(java.lang.String name)
Extract a bound variable
|
ComprehensionsModule.ComprehensionData<T,R> |
$(java.lang.String name,
ComprehensionsModule.InternalSupplier f)
Lazily bind a variable in this for comprehension
|
ComprehensionsModule.ComprehensionData<T,R> |
$(java.lang.String name,
java.lang.Object f)
Bind a variable in this for comprehension
|
ComprehensionsModule.ComprehensionData<T,R> |
filter(java.util.function.Supplier<java.lang.Boolean> s)
Add a guard to the for comprehension
|
R |
yield(java.util.function.Supplier<R> s)
Define the yeild section of a for comprehension and kick of
processing for a comprehension
|
public ComprehensionsModule.ComprehensionData<T,R> filter(java.util.function.Supplier<java.lang.Boolean> s)
foreachX(c -> c.$("hello",list)
.filter(()->c.<Integer>$("hello")<10)
.yield(()-> c.<Integer>$("hello")+2));
s - Supplier that returns true for elements that should stay
in the comprehensionpublic R yield(java.util.function.Supplier<R> s)
foreachX(c -> c.$("hello",list)
.filter(()->c.<Integer>$("hello")<10)
.yield(()-> c.<Integer>$("hello")+2));
s - Yield sectionpublic T $(java.lang.String name)
foreachX(c -> c.$("hello",list)
.filter(()->c.<Integer>$("hello")<10)
.yield(()-> c.<Integer>$("hello")+2));
name - Variable namepublic ComprehensionsModule.ComprehensionData<T,R> $(java.lang.String name, java.lang.Object f)
foreachX(c -> c.$("hello",list)
.filter(()->c.<Integer>$("hello")<10)
.yield(()-> c.<Integer>$("hello")+2));
name - of variable to bindf - valuepublic ComprehensionsModule.ComprehensionData<T,R> $(java.lang.String name, ComprehensionsModule.InternalSupplier f)
foreachX(c -> c.$("hello",list)
.filter(()->c.<Integer>$("hello")<10)
.yield(()-> c.<Integer>$("hello")+2));
name - name of variable to bindf - value