org.shapelogic.streams
Class IteratorStream<E>
java.lang.Object
org.shapelogic.streams.BaseCommonStream<E>
org.shapelogic.streams.BaseListCommonStream<E>
org.shapelogic.streams.IteratorStream<E>
- All Implemented Interfaces:
- java.lang.Iterable<E>, java.util.Iterator<E>, CalcValue<E>, ContextGettable, LazyCalc<E>, RecursiveContext, ListStream<E>, NumberedStream<E>, Stream<E>, StreamProperties
public class IteratorStream<E>
- extends BaseListCommonStream<E>
Stream based on Iterator that can be set.
- Author:
- Sami Badawi
Field Summary |
protected java.util.Iterator<E> |
_iterator
|
Methods inherited from class org.shapelogic.streams.BaseListCommonStream |
calcAddNext, get, getCurrentSize, getList, hasNextBase, isCached, isRandomAccess, iterator, next, setLastFromInput, setList |
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 java.util.Iterator |
remove |
_iterator
protected java.util.Iterator<E> _iterator
IteratorStream
public IteratorStream(java.util.Iterator<E> iterator,
int maxLast)
IteratorStream
public IteratorStream(java.util.Iterator<E> iterator)
invokeIndex
public E invokeIndex(int index)
- Description copied from class:
BaseListCommonStream
- Calculate the value at an index.
So it gets the needed input value and call the appropriate invoke function.
Can this be used for a filter call?
The index does not make sense for a filter since you do not know where
the input is coming from. So maybe just ignore it.
This is a little messy but less messy that what is there now.
- Specified by:
invokeIndex
in class BaseListCommonStream<E>
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator<E>
- Overrides:
hasNext
in class BaseListCommonStream<E>
getIterator
public java.util.Iterator<E> getIterator()
setIterator
public void setIterator(java.util.Iterator<E> iterator)
Copyright © 2009. All Rights Reserved.