public abstract class AAccumulationIterator extends Object implements Iterator<ITracePoint2D>
Iterator
that decorates an iterator by the feature of accumulation of
points.
Contract:
NaN
must be accumulated. Those are
discontinuations and must be preserved.Iterator.next()
has to return the same as the first point
in the given / wrapped iterator in case that the visible range does not
exclude it.Iterator.next()
has to return the same as the last point in
the given / wrapped iterator in case that the visible range does not exclude
it.Iterator.next()
has to be
an interpolated point at the exact coordinate of the lower bound of the
range.Iterator.next()
has to be
an interpolated point at the exact coordinate of the upper bound of the
range.ITracePoint2D.isDiscontinuation()
) has been
returned the next visible point must not be accumulated but returned as-is to
prevent showing a bigger gap than actually exists!Constructor and Description |
---|
AAccumulationIterator(ITrace2D originalTrace,
IAccumulationFunction accumulationFunction,
IAccumulationStrategy.IAccumulationControl accumulationControl)
Constructor with all that is needed for accumulating points.
|
Modifier and Type | Method and Description |
---|---|
protected IAccumulationStrategy.IAccumulationControl |
getAccumulationControl()
Returns the termination criteria for each accumulation.
|
protected IAccumulationFunction |
getAccumulationFunction()
Returns the accumulationFunction.
|
protected Iterator<ITracePoint2D> |
getOriginalIterator()
Returns the stateful iterator of the original trace.
|
protected ITrace2D |
getOriginalTrace()
Returns the original trace.
|
void |
remove()
Throws an
UnsupportedOperationException as there is no 1-1
relationship between output of this iterator and source (as there is data
accumulation in effect). |
protected void |
setOriginalTrace(ITrace2D originalTrace)
Sets original trace that is decorated with the point accumulation feature.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, hasNext, next
public AAccumulationIterator(ITrace2D originalTrace, IAccumulationFunction accumulationFunction, IAccumulationStrategy.IAccumulationControl accumulationControl)
originalTrace
- the iterator to decorate with the feature of accumulating points.accumulationFunction
- the function to use for point - accumulation.accumulationControl
- termination criteria for a single accumulation run. Note that it's
IAccumulationStrategy.IAccumulationControl.initializeControl(int, int)
method
has to be been called before.protected IAccumulationStrategy.IAccumulationControl getAccumulationControl()
protected void setOriginalTrace(ITrace2D originalTrace)
This will also reset the getOriginalIterator()
.
originalTrace
- the originalTrace to setprotected IAccumulationFunction getAccumulationFunction()
protected ITrace2D getOriginalTrace()
protected Iterator<ITracePoint2D> getOriginalIterator()
public final void remove()
UnsupportedOperationException
as there is no 1-1
relationship between output of this iterator and source (as there is data
accumulation in effect).
remove
in interface Iterator<ITracePoint2D>
Iterator.remove()
Copyright © 2018. All rights reserved.