org.shapelogic.streams
Class CalcNumberedStream1<In,E>

java.lang.Object
  extended by org.shapelogic.streams.BaseCommonStream<E>
      extended by org.shapelogic.streams.BaseCommonNumberedStream<E>
          extended by org.shapelogic.streams.BaseNumberedStream1<In,E>
              extended by org.shapelogic.streams.CalcNumberedStream1<In,E>
All Implemented Interfaces:
java.util.Iterator<E>, Calc1<In,E>, CalcValue<E>, ContextGettable, LazyCalc<E>, RecursiveContext, InputStream1<In,E>, NumberedStream<E>, Stream<E>, StreamProperties

public class CalcNumberedStream1<In,E>
extends BaseNumberedStream1<In,E>

Make a stream that is using a Calc1 class to do a calculation, based on a named input stream stored in a context.
Based on ListCalcStream1.
Uses lazy setup so input stream does not have to exist when stream is created.
There should be a way to say whether you have to calculate all the values sequentially to use this.
Close to NamedListCalcStream1, but with no caching.

Author:
Sami Badawi

Field Summary
protected  Calc1<In,E> _calc
           
 
Fields inherited from class org.shapelogic.streams.BaseNumberedStream1
_inputStream
 
Fields inherited from class org.shapelogic.streams.BaseCommonStream
_context, _current, _dirty, _last, _maxLast, _name, _nullLegalValue, _parentContext, _query, _value
 
Constructor Summary
CalcNumberedStream1()
           
CalcNumberedStream1(Calc1<In,E> calc, int maxLast)
           
CalcNumberedStream1(Calc1<In,E> calc, NumberedStream<In> inputStream)
           
CalcNumberedStream1(Calc1<In,E> calc, NumberedStream<In> inputStream, int maxLast)
           
 
Method Summary
 E invoke(In input)
           
 
Methods inherited from class org.shapelogic.streams.BaseNumberedStream1
getInput, getInputStream, invokeIndex, setLastFromInput
 
Methods inherited from class org.shapelogic.streams.BaseCommonNumberedStream
calcAddNext, get, hasNext, hasNextBase, isCached, isRandomAccess, next, setLast
 
Methods inherited from class org.shapelogic.streams.BaseCommonStream
getContext, getInContext, getIndex, getLast, getMaxLast, getName, getParentContext, getValue, isDeterministic, isDirty, isNullLegalValue, remove, setMaxLast, setNullLegalValue, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_calc

protected Calc1<In,E> _calc
Constructor Detail

CalcNumberedStream1

public CalcNumberedStream1(Calc1<In,E> calc,
                           NumberedStream<In> inputStream,
                           int maxLast)

CalcNumberedStream1

public CalcNumberedStream1(Calc1<In,E> calc,
                           NumberedStream<In> inputStream)

CalcNumberedStream1

public CalcNumberedStream1()

CalcNumberedStream1

public CalcNumberedStream1(Calc1<In,E> calc,
                           int maxLast)
Method Detail

invoke

public E invoke(In input)


Copyright © 2009. All Rights Reserved.