|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.calculation.CalcComposition
public class CalcComposition
Compose Calculations.
compose(calc1,calc0).invoke(x) == calc1.invoke(calc0.invoke(x))
So they are composed from the right.
Not sure how these would work with more complicated classes.
Say compose a Stream with another stream.
I think that this is a stream compose.
What about an CalcValue with a Calc1 I think that should give a CalcInvoke.
But this is ambiguous if added to this class.
So either give these a different name. Or add to a different class.
What makes this worse is that a Stream implementation is also both a Calc1
and a CalcValue.
So do not add this now.
Constructor Summary | |
---|---|
CalcComposition()
|
Method Summary | ||
---|---|---|
static
|
compose(Calc1<In1,Out> calc1,
Calc1<In0,In1> calc0)
Composition of calculations / closures with 1 input and 1 output. |
|
static
|
compose(Calc1<In1,Out> calc1,
CalcIndex1<In0,In1> calc0)
Compose calculation with 1 input and one index and calculation with 1 input. |
|
static
|
compose(Calc1<In,Out> calc1,
Calc0<In> calc0)
Composition of calculations with 0 input and 1 input. |
|
static
|
compose(Calc1<In,Out> calc1,
CalcIndex0<In> calc0)
Compose calculation with index and calculation with 1 input |
|
static
|
compose(CalcIndex1<In1,Out> calc1,
CalcIndex1<In0,In1> calc0)
Compose 2 calculations with 1 input and one index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CalcComposition()
Method Detail |
---|
public static <In0,In1,Out> Calc1<In0,Out> compose(Calc1<In1,Out> calc1, Calc1<In0,In1> calc0)
In0
- In1
- Out
- calc1
- second calculationcalc0
- first calculation
public static <In,Out> Calc0<Out> compose(Calc1<In,Out> calc1, Calc0<In> calc0)
In
- Out
- calc1
- calc0
-
public static <In,Out> CalcIndex0<Out> compose(Calc1<In,Out> calc1, CalcIndex0<In> calc0)
In
- Out
- calc1
- calc0
-
public static <In0,In1,Out> CalcIndex1<In0,Out> compose(Calc1<In1,Out> calc1, CalcIndex1<In0,In1> calc0)
In0
- In1
- Out
- calc1
- calc0
-
public static <In0,In1,Out> CalcIndex1<In0,Out> compose(CalcIndex1<In1,Out> calc1, CalcIndex1<In0,In1> calc0)
In0
- In1
- Out
- calc1
- calc0
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |