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

java.lang.Object
  extended by org.shapelogic.streams.BaseCommonStream<E>
      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
_list
 
Fields inherited from class org.shapelogic.streams.BaseCommonStream
_context, _current, _dirty, _last, _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, getCurrentSize, hasNext, hasNextBase, isCached, isRandomAccess, iterator, next
 
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
 
Methods inherited from interface org.shapelogic.streams.NumberedStream
getIndex, getLast, getMaxLast, setMaxLast
 
Methods inherited from interface org.shapelogic.calculation.LazyCalc
isDirty, setup
 
Methods inherited from interface org.shapelogic.calculation.CalcValue
getValue
 
Methods inherited from interface java.util.Iterator
remove
 

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 © 2009. All Rights Reserved.