public static interface IAccumulationStrategy.IAccumulationControl
Modifier and Type | Method and Description |
---|---|
ITracePoint2D |
getAccumulatedPointIfAccumulationDone(IAccumulationFunction function,
ITracePoint2D current)
Modifier that checks if the given function has accumulated enough points.
|
void |
initializeControl(int totalAmountOfPoints,
int desiredAmountOfPoints)
This has to be called by users of this instance (
AAccumulationIterator before starting an iteration / using this. |
boolean |
isAccumulationBypassable()
Returns true if data accumulation is according to the configuration of
this control not needed.
|
boolean |
isAccumulationDone()
Accessor that returns true if the current accumulation is complete.
|
ITracePoint2D getAccumulatedPointIfAccumulationDone(IAccumulationFunction function, ITracePoint2D current)
If accumulation is not done yet the current point is added to the
accumulation function and null
is returned.
Implementations may use different strategies to find out if accumulation is done or not: Accumulate a fixed amount of points or split the range up to have density based accumulation,... .
function
- the accumulation function to use.current
- the current iterated point.null
if accumulation is
not done yet.void initializeControl(int totalAmountOfPoints, int desiredAmountOfPoints)
AAccumulationIterator
before starting an iteration / using this.
totalAmountOfPoints
- the total amount of points in the original data source.desiredAmountOfPoints
- the desired amount of points coming out of the accumulation.
Note that depending on the implementation this must not be hit
exactly: Implementations might e.g. decide to accumulate
n-consecutive points by an initial computation. In the
accumulation run then it may happen that series of invisible
points are found which are - roughly said -skipped.boolean isAccumulationBypassable()
This e.g. may be the case if the control accumulates n points into one but detected that there more resulting points are desired than total points exist.
Please note: Result is only valid if initializeControl(int, int)
has been called before!
boolean isAccumulationDone()
Nothing is modified.
Contract is that this returns true whenever a call to
getAccumulatedPointIfAccumulationDone(IAccumulationFunction, ITracePoint2D)
directly afterwards would not return null
but a valid
accumulated ITracePoint2D
.
Copyright © 2019. All rights reserved.