org.shapelogic.streams
Class BaseListFilterStream<E>

java.lang.Object
  extended by org.shapelogic.streams.BaseListCommonStream<E>
      extended by org.shapelogic.streams.BaseListStream1<E,E>
          extended by org.shapelogic.streams.BaseListFilterStream<E>
Type Parameters:
E -
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Iterator<E>, Calc<E>, LazyCalc<E>, FilterStream<E>, IndexedInputStream1<E,E>, ListFilterStream<E>, ListStream<E>, NumberedStream<E>, Stream<E>, StreamProperties

public abstract class BaseListFilterStream<E>
extends BaseListStream1<E,E>
implements ListFilterStream<E>

This is the abstract class to override to make a ListFilterStream. The code here is the same as what would be in the BaseFilterStream.

Author:
Sami Badawi

Field Summary
 
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
BaseListFilterStream(ListStream<E> inputStream)
           
 
Method Summary
 boolean hasNext()
           
 E invoke(E input, int index)
          Closure to calculated 1 individual element based on index and input for the same index.
 E next()
           
 
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, hasNextBase, isCached, isContextBased, isDeterministic, isDirty, isRandomAccess, iterator, remove, setMaxLast, 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.FilterStream
evaluate
 
Methods inherited from interface org.shapelogic.streams.ListStream
getList, setList
 
Methods inherited from interface org.shapelogic.streams.NumberedStream
get, getIndex, getLast, getMaxLast, setMaxLast
 
Methods inherited from interface org.shapelogic.calculation.LazyCalc
isDirty, setup
 
Methods inherited from interface org.shapelogic.calculation.Calc
getValue
 
Methods inherited from interface java.util.Iterator
remove
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

BaseListFilterStream

public BaseListFilterStream(ListStream<E> inputStream)
Method Detail

invoke

public E invoke(E 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.

Specified by:
invoke in interface IndexedInputStream1<E,E>
index - of element in list

next

public E next()
Specified by:
next in interface java.util.Iterator<E>
Overrides:
next in class BaseListCommonStream<E>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<E>
Overrides:
hasNext in class BaseListCommonStream<E>


Copyright © 2008. All Rights Reserved.