org.shapelogic.streams
Class BaseListFilterTransformerStream<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.BaseListFilterTransformerStream<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, Transformer<E,Out>, FilterTransformerStream<E,Out>, 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 abstract class BaseListFilterTransformerStream<E,Out>
extends BaseListStream1<E,java.util.Map.Entry<E,Out>>
implements FilterTransformerStream<E,Out>

This is the abstract class to override to make a ListFilterStream. The code here is the same as what would be in the BaseFilterStream. This is a little problematic there are 2 calculation that need to be made. So they cannot both have the same method name: invoke(input)
You can either take one of them as a Transformer or as a Calc1 member.
This one is implementing Transformer

Author:
Sami Badawi

Field Summary
 
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
BaseListFilterTransformerStream(NumberedStream<E> inputStream)
           
 
Method Summary
 java.util.Map.Entry<E,Out> invoke(E input)
           
 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.calculation.LazyCalc
isDirty, setup
 
Methods inherited from interface org.shapelogic.calculation.CalcValue
getValue
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 
Methods inherited from interface org.shapelogic.calculation.Transformer
transform
 
Methods inherited from interface org.shapelogic.streams.NumberedStream
getIndex, getLast, getMaxLast, setMaxLast
 

Constructor Detail

BaseListFilterTransformerStream

public BaseListFilterTransformerStream(NumberedStream<E> inputStream)
Method Detail

invoke

public java.util.Map.Entry<E,Out> invoke(E input)
Specified by:
invoke in interface Calc1<E,java.util.Map.Entry<E,Out>>

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.