org.shapelogic.streams
Class ListFilterCalcStream1<E,Out>

java.lang.Object
  extended by org.shapelogic.streams.BaseCommonStream<E>
      extended by org.shapelogic.streams.BaseListCommonStream<E>
          extended by org.shapelogic.streams.BaseListStream1<E,java.util.Map.Entry<E,Out>>
              extended by org.shapelogic.streams.ListFilterCalcStream1<E,Out>
Type Parameters:
E -
All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<E,Out>>, java.util.Iterator<java.util.Map.Entry<E,Out>>, Calc1<E,java.util.Map.Entry<E,Out>>, CalcValue<java.util.Map.Entry<E,Out>>, ContextGettable, LazyCalc<java.util.Map.Entry<E,Out>>, RecursiveContext, InputStream1<E,java.util.Map.Entry<E,Out>>, ListStream<java.util.Map.Entry<E,Out>>, NumberedStream<java.util.Map.Entry<E,Out>>, Stream<java.util.Map.Entry<E,Out>>, StreamProperties

public class ListFilterCalcStream1<E,Out>
extends BaseListStream1<E,java.util.Map.Entry<E,Out>>

Does calculation on input and if it is different from null return Entry of input result.

Author:
Sami Badawi

Field Summary
protected  Calc1<E,Out> _calc1
           
 
Fields inherited from class org.shapelogic.streams.BaseListStream1
_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
ListFilterCalcStream1(NumberedStream<E> inputStream, Calc1<E,Out> calc1)
           
 
Method Summary
 Calc1<E,Out> getCalc1()
           
 java.util.Map.Entry<E,Out> invoke(E input)
          Maybe I could make this the predicate method, so if null is returned then don't add anything.
 java.util.Map.Entry<E,Out> invokeIndex(int index)
          Ignore the index, and iterate over the input stream until a non null value is found.
 
Methods inherited from class org.shapelogic.streams.BaseListStream1
getInput, getInputStream, getList, 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

_calc1

protected final Calc1<E,Out> _calc1
Constructor Detail

ListFilterCalcStream1

public ListFilterCalcStream1(NumberedStream<E> inputStream,
                             Calc1<E,Out> calc1)
Method Detail

getCalc1

public Calc1<E,Out> getCalc1()

invoke

public java.util.Map.Entry<E,Out> invoke(E input)
Maybe I could make this the predicate method, so if null is returned then don't add anything. Or this could just be the identity.


invokeIndex

public java.util.Map.Entry<E,Out> invokeIndex(int index)
Ignore the index, and iterate over the input stream until a non null value is found.

Overrides:
invokeIndex in class BaseListStream1<E,java.util.Map.Entry<E,Out>>


Copyright © 2009. All Rights Reserved.