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