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

java.lang.Object
  extended by org.shapelogic.streams.BaseListCommonStream<E>
      extended by org.shapelogic.streams.BaseListStream1<In,E>
          extended by org.shapelogic.streams.TransformerListStream<In,E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Iterator<E>, Calc<E>, LazyCalc<E>, IndexedInputStream1<In,E>, ListStream<E>, NumberedStream<E>, Stream<E>, StreamProperties

public class TransformerListStream<In,E>
extends BaseListStream1<In,E>

Make a stream that is using a Transformer class to do a calculation

Author:
Sami Badawi

Field Summary
protected  IndexTransform<In,E> _transformer
           
 
Fields inherited from class org.shapelogic.streams.BaseListStream1
_inputStream
 
Fields inherited from class org.shapelogic.streams.BaseListCommonStream
_current, _dirty, _last, _list, _maxLast, _name, _value
 
Constructor Summary
TransformerListStream()
           
TransformerListStream(IndexTransform<In,E> transformer)
           
TransformerListStream(IndexTransform<In,E> transformer, 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.BaseListStream1
getInput, getInputStream, getList, invokeIndex, setList
 
Methods inherited from class org.shapelogic.streams.BaseListCommonStream
calcAddNext, get, getContext, getCurrentSize, getIndex, getLast, getMaxLast, getName, getValue, hasNext, hasNextBase, isCached, isContextBased, isDeterministic, isDirty, isRandomAccess, iterator, next, remove, setMaxLast, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_transformer

protected IndexTransform<In,E> _transformer
Constructor Detail

TransformerListStream

public TransformerListStream()

TransformerListStream

public TransformerListStream(IndexTransform<In,E> transformer)

TransformerListStream

public TransformerListStream(IndexTransform<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.