org.shapelogic.streams
Interface NumberedStream<E>

All Superinterfaces:
CalcValue<E>, java.util.Iterator<E>, LazyCalc<E>, Stream<E>
All Known Subinterfaces:
CartesianIndex, ListFilterStream<E>, ListStream<E>
All Known Implementing Classes:
AddListStream, AndListStream, ArrayOutputListStream, BaseCommonNumberedStream, BaseCommonStream, BaseListCommonStream, BaseListFilterStream, BaseListFilterTransformerStream, BaseListIndexedStream1, BaseListStream0, BaseListStream1, BaseListStream2, BaseListStreamList, BaseNumberedStream1, CalcNumberedStream1, CartesianIndex2, IteratorStream, ListCalcIndexStream1, ListCalcStream1, ListFilterCalcStream1, NamedListCalcStream1, NamedListStream, NamedNumberedStream, NamedNumberedStreamLazySetup, NaturalNumberStream, NumericTruthTableStream, PredicateListFilterStream, PrimeNumberStream, SingleListStream, SVGReader, WrappedListStream, XOrListStream

public interface NumberedStream<E>
extends Stream<E>

NumberedStream is a Sequential Stream where each element has an intrinsic number.

Author:
Sami Badawi

Method Summary
 E get(int input)
          Get the calculate value for index based on the previous stream.
 int getIndex()
          Index of last successfully processed element.
 int getLast()
          Last possible element.
 int getMaxLast()
          Manually set max value for last possible element.
 void setMaxLast(int maxLast)
          Set a max value for last possible element.
 
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
 

Method Detail

get

E get(int input)
Get the calculate value for index based on the previous stream.

So it just calls invoke(getInputStream().get(index), index)

Parameters:
index - in
Returns:

getIndex

int getIndex()
Index of last successfully processed element.


getLast

int getLast()
Last possible element.
If last is not known then this is set to LAST_UNKNOWN.
When you add a new element this will not grow.
When maxLast is set so it this, but this can can get lower.
Set when you find the end.

If you use this for iteration you need to call the function at each iteration.


getMaxLast

int getMaxLast()
Manually set max value for last possible element.


setMaxLast

void setMaxLast(int maxLast)
Set a max value for last possible element.



Copyright © 2009. All Rights Reserved.