public static class IAccumulationStrategy.AccumulationControlConsecutivePoints extends Object implements IAccumulationStrategy.IAccumulationControl
Constructor and Description |
---|
AccumulationControlConsecutivePoints()
Default constructor which does not initialize everything needed as that
has to be done by the concrete
AAccumulationIterator
implementation which works with this. |
Modifier and Type | Method and Description |
---|---|
ITracePoint2D |
getAccumulatedPointIfAccumulationDone(IAccumulationFunction function,
ITracePoint2D current)
Modifier that checks if the given function has accumulated enough points.
|
int |
getAmountToAccumulate()
Returns the amount of points to accumulate.
|
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.
|
public AccumulationControlConsecutivePoints()
AAccumulationIterator
implementation which works with this.
Those have to call initializeControl(int, int)
first!
public ITracePoint2D getAccumulatedPointIfAccumulationDone(IAccumulationFunction function, ITracePoint2D current)
IAccumulationStrategy.IAccumulationControl
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,... .
getAccumulatedPointIfAccumulationDone
in interface IAccumulationStrategy.IAccumulationControl
function
- the accumulation function to use.current
- the current iterated point.null
if accumulation is
not done yet.IAccumulationStrategy.IAccumulationControl.getAccumulatedPointIfAccumulationDone(info.monitorenter.gui.chart.IAccumulationFunction,
info.monitorenter.gui.chart.ITracePoint2D)
public int getAmountToAccumulate()
public void initializeControl(int totalAmountOfPoints, int desiredAmountOfPoints)
IAccumulationStrategy.IAccumulationControl
AAccumulationIterator
before starting an iteration / using this.
initializeControl
in interface IAccumulationStrategy.IAccumulationControl
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.IAccumulationStrategy.IAccumulationControl.initializeControl(int,
int)
public boolean isAccumulationBypassable()
IAccumulationStrategy.IAccumulationControl
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 IAccumulationStrategy.IAccumulationControl.initializeControl(int, int)
has been called before!
isAccumulationBypassable
in interface IAccumulationStrategy.IAccumulationControl
IAccumulationStrategy.IAccumulationControl.isAccumulationBypassable()
public boolean isAccumulationDone()
IAccumulationStrategy.IAccumulationControl
Nothing is modified.
Contract is that this returns true whenever a call to
IAccumulationStrategy.IAccumulationControl.getAccumulatedPointIfAccumulationDone(IAccumulationFunction, ITracePoint2D)
directly afterwards would not return null
but a valid
accumulated ITracePoint2D
.
isAccumulationDone
in interface IAccumulationStrategy.IAccumulationControl
IAccumulationStrategy.IAccumulationControl.isAccumulationDone()
Copyright © 2019. All rights reserved.