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

java.lang.Object
  extended by org.shapelogic.streams.BaseListCommonStream<E>
      extended by org.shapelogic.streams.BaseListIndexedStream1<In,E>
          extended by org.shapelogic.streams.ListCalcIndexStream1<In,E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Iterator<E>, CalcValue<E>, ContextGettable, LazyCalc<E>, RecursiveContext, IndexedInputStream1<In,E>, ListStream<E>, NumberedStream<E>, Stream<E>, StreamProperties

public class ListCalcIndexStream1<In,E>
extends BaseListIndexedStream1<In,E>

Make a stream that is using a Transformer class to do a calculation.
In type does not seem to be used.
XXX This should be called ListCalcIndexStream1 or something close to that.

Author:
Sami Badawi

Field Summary
protected  CalcIndex1<In,E> _calc
           
 
Fields inherited from class org.shapelogic.streams.BaseListIndexedStream1
_inputStream
 
Fields inherited from class org.shapelogic.streams.BaseListCommonStream
_context, _current, _dirty, _last, _list, _maxLast, _name, _nullLegalValue, _parentContext, _query, _value
 
Constructor Summary
ListCalcIndexStream1()
           
ListCalcIndexStream1(CalcIndex1<In,E> transformer)
           
ListCalcIndexStream1(CalcIndex1<In,E> transformer, int maxLast)
           
ListCalcIndexStream1(CalcIndex1<In,E> calc, NumberedStream<In> inputStream)
           
ListCalcIndexStream1(CalcIndex1<In,E> calc, NumberedStream<In> inputStream, int maxLast)
           
 
Method Summary
 E invoke(In input, int index)
          Closure to calculated 1 individual element based on index and input for the same index.
 
Methods inherited from class org.shapelogic.streams.BaseListIndexedStream1
getInput, getInputStream, getList, invokeIndex, setLastFromInput, setList
 
Methods inherited from class org.shapelogic.streams.BaseListCommonStream
calcAddNext, get, getContext, getCurrentSize, getInContext, getIndex, getLast, getMaxLast, getName, getParentContext, getValue, hasNext, hasNextBase, isCached, isDeterministic, isDirty, isNullLegalValue, isRandomAccess, iterator, next, 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 CalcIndex1<In,E> _calc
Constructor Detail

ListCalcIndexStream1

public ListCalcIndexStream1(CalcIndex1<In,E> calc,
                            NumberedStream<In> inputStream,
                            int maxLast)

ListCalcIndexStream1

public ListCalcIndexStream1(CalcIndex1<In,E> calc,
                            NumberedStream<In> inputStream)

ListCalcIndexStream1

public ListCalcIndexStream1(CalcIndex1<In,E> transformer)

ListCalcIndexStream1

public ListCalcIndexStream1()

ListCalcIndexStream1

public ListCalcIndexStream1(CalcIndex1<In,E> transformer,
                            int maxLast)
Method Detail

invoke

public E invoke(In input,
                int index)
Description copied from interface: IndexedInputStream1
Closure to calculated 1 individual element based on index and input for the same index. Should later just call the invoke on the closure. Maybe this should be moved up later.

index - of element in list


Copyright © 2008. All Rights Reserved.