|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.shapelogic.streams.BaseStream2<In0,In1,E>
In0 - In1 - E - public abstract class BaseStream2<In0,In1,E>
BaseDeclarativeStreamInputs2 a Stream with 2 inputs. The idea is that you can do a calculation, with 2 input and 1 output. This could be used directly for a zip operation, but not if you need a Cartesian product. I need a Cartesian product operation what should that be defined as? I just need to override hasNext() and next(). This seem like the work for a mixin. I think that this seems like a good solution, I do not think that you need to store all the values in a Cartesian product. Do I need all the classes sequential, number and list? I think that if you do a zip you just need 2 Interators as input. For anything else you need a list input. Output that make sense: sequential, number and list. I think that maybe they can be sub classed from each other.
| Field Summary | |
|---|---|
protected boolean |
_dirty
|
protected Stream<In0> |
_inputStream0
|
protected Stream<In1> |
_inputStream1
|
protected E |
_value
|
| Constructor Summary | |
|---|---|
BaseStream2()
|
|
| Method Summary | |
|---|---|
Stream<In0> |
getInputStream0()
Stream that this stream is connected to. |
Stream<In1> |
getInputStream1()
|
E |
getValue()
Starts a lazy calculation. |
boolean |
hasNext()
|
abstract E |
invoke(In0 input0,
In1 input1)
|
boolean |
isDirty()
When dirty is false that means that the calculated value can be used |
E |
next()
|
void |
remove()
|
void |
setup()
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean _dirty
protected Stream<In0> _inputStream0
protected Stream<In1> _inputStream1
protected E _value
| Constructor Detail |
|---|
public BaseStream2()
| Method Detail |
|---|
public Stream<In0> getInputStream0()
InputsStream2
getInputStream0 in interface InputsStream2<In0,In1,E>public Stream<In1> getInputStream1()
getInputStream1 in interface InputsStream2<In0,In1,E>public E getValue()
CalcValue
getValue in interface CalcValue<E>
public abstract E invoke(In0 input0,
In1 input1)
invoke in interface Calc2<In0,In1,E>public boolean isDirty()
LazyCalc
isDirty in interface LazyCalc<E>public void setup()
LazyCalc
setup in interface LazyCalc<E>public boolean hasNext()
hasNext in interface java.util.Iterator<E>public E next()
next in interface java.util.Iterator<E>public void remove()
remove in interface java.util.Iterator<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||