org.shapelogic.mathematics
Class NaturalNumberStream
java.lang.Object
org.shapelogic.streams.BaseCommonStream<E>
org.shapelogic.streams.BaseCommonNumberedStream<java.lang.Integer>
org.shapelogic.mathematics.NaturalNumberStream
- All Implemented Interfaces:
- java.util.Iterator<java.lang.Integer>, CalcValue<java.lang.Integer>, ContextGettable, LazyCalc<java.lang.Integer>, RecursiveContext, NumberedStream<java.lang.Integer>, Stream<java.lang.Integer>, StreamProperties
public class NaturalNumberStream
- extends BaseCommonNumberedStream<java.lang.Integer>
Generated Natural Number.
There can be both a start and stop value:
start index default 0
max last / last number default not set
- Author:
- Sami Badawi
Methods inherited from class org.shapelogic.streams.BaseCommonStream |
getContext, getInContext, getIndex, getLast, getMaxLast, getName, getParentContext, getValue, isDeterministic, isDirty, isNullLegalValue, remove, setLastFromInput, setMaxLast, setNullLegalValue, setup |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NaturalNumberStream
public NaturalNumberStream()
NaturalNumberStream
public NaturalNumberStream(int maxLast)
NaturalNumberStream
public NaturalNumberStream(int startIndex,
java.lang.Integer maxLast)
getStartIndex
public int getStartIndex()
invokeIndex
public java.lang.Integer invokeIndex(int index)
- Description copied from class:
BaseCommonNumberedStream
- 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 BaseCommonNumberedStream<java.lang.Integer>
Copyright © 2009. All Rights Reserved.