public class Trace2DArithmeticMean extends ATrace2D
This trace will not reduce the amount of n points added to one carrying the arithmetic mean but always add a point that has the average of the recent added n points.
Please note that this trace scan be used in two modes:
ITrace2D implementation to a chart and add data points
to it as normal.ITrace2D implementation as a computing trace to an
existing trace via
ITrace2D.addComputingTrace(info.monitorenter.gui.chart.ITrace2D)
and only add data points to the original trace. Add the computing trace to
the same chart and updates of the original trace will be reflected on the
computing trace as well.ITrace2D.DistancePointm_computingTraces, m_maxX, m_maxXErrorBar, m_maxY, m_maxYErrorBar, m_minX, m_minXErrorBar, m_minY, m_minYErrorBar, m_name, m_physicalUnitsX, m_physicalUnitsY, m_propertyChangeSupport, m_rendererPROPERTY_ACCUMULATION_STRATEGY, PROPERTY_ACCUMULATION_STRATEGY_ACCUMULATION_FUNCTION_CHANGEDPROPERTY_COLOR, PROPERTY_ERRORBARPOLICY, PROPERTY_ERRORBARPOLICY_CONFIGURATION, PROPERTY_LABEL, PROPERTY_MAX_X, PROPERTY_MAX_Y, PROPERTY_MIN_X, PROPERTY_MIN_Y, PROPERTY_NAME, PROPERTY_PAINTERS, PROPERTY_PHYSICALUNITS, PROPERTY_STROKE, PROPERTY_TRACEPOINT_CHANGED_HIGHLIGHTERS, PROPERTY_TRACEPOINT_CHANGED_LOCATION, PROPERTY_TRACEPOINT_CHANGED_RENDERING, PROPERTY_TRACEPOINTS, PROPERTY_VISIBLE, PROPERTY_ZINDEX, Z_INDEX_MIN, ZINDEX_MAX| Constructor and Description |
|---|
Trace2DArithmeticMean(int arithmenticMeanSpan)
The amount of n recent points to buffer.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addPointInternal(ITracePoint2D p)
Override this template method for the custom add operation that depends on
the policies of the implementation.
|
Iterator<ITracePoint2D> |
descendingIterator()
Returns an
Iterator over the internal
instances in reverse order. |
boolean |
equals(Object obj) |
int |
getMaxSize()
Returns the maximum amount of
ITracePoint2D instances that may be
added. |
int |
getSize()
Returns the amount of
ITracePoint2D instances currently contained. |
int |
hashCode() |
boolean |
isEmpty()
Returns false if internal
instances are
contained or true if not. |
Iterator<ITracePoint2D> |
iterator()
Returns an
Iterator over the internal
instances. |
protected void |
removeAllPointsInternal()
Override this template method for the custom remove operation that depends
on the
Collection used in the implementation. |
protected ITracePoint2D |
removePointInternal(ITracePoint2D point)
Override this template method for the custom remove operation that depends
on the internal storage the implementation.
|
addComputingTrace, addErrorBarPolicy, addPoint, addPoint, addPoint, addPointHighlighter, addPropertyChangeListener, addTracePainter, boundSearch, compareTo, containsTracePainter, ensureInitialized, finalize, firePointAdded, firePointChanged, firePointRemoved, firePropertyChange, getAccumulationStrategy, getChangeListeners, getColor, getErrorBarPolicies, getHasErrorBars, getInstanceCount, getLabel, getMaxX, getMaxY, getMinX, getMinY, getName, getNearestPointEuclid, getNearestPointManhattan, getPhysicalUnits, getPhysicalUnitsX, getPhysicalUnitsY, getPointHighlighters, getPropertyChangeListeners, getRenderer, getStroke, getTracePainters, getTracePointProvider, getZIndex, initPaintIteration, isAdditionalSpaceRequired, isPixelTransformationRequired, isVisible, iterator, maxXSearch, maxYSearch, minXSearch, minYSearch, onAdded2ChartBeforeFirstPaint, propertyChange, removeAllPointHighlighters, removeAllPoints, removeComputingTrace, removeErrorBarPolicy, removePoint, removePointHighlighter, removePropertyChangeListener, removePropertyChangeListener, removeTracePainter, setAccumulationStrategy, setColor, setErrorBarPolicy, setName, setPhysicalUnits, setPointHighlighter, setRenderer, setStroke, setTracePainter, setTracePointProvider, setVisible, setZIndex, showsErrorBars, showsNegativeXErrorBars, showsNegativeYErrorBars, showsPositiveXErrorBars, showsPositiveYErrorBars, toStringpublic Trace2DArithmeticMean(int arithmenticMeanSpan)
arithmenticMeanSpan - the amount of points to merge into one point with their arithmetic
mean.protected boolean addPointInternal(ITracePoint2D p)
ATrace2DOverride this template method for the custom add operation that depends on the policies of the implementation.
No property change events have to be fired by default. If this method
returns true the outer logic of the calling method
will perform bound checks for
the new point and fire property changes as described in method
ATrace2D.addPoint(ITracePoint2D)
.
ATrace2D.firePointChanged(ITracePoint2D, info.monitorenter.gui.chart.ITracePoint2D.STATE, Object, Object)
In special cases - when additional modifications to the internal set of points take place (e.g. a further point gets removed) this method should return false (regardless whether the new point was accepted or not) and perform bound checks and fire the property changes as mentioned above "manually".
addPointInternal in class ATrace2Dp - the point to add.ATrace2D.addPointInternal(info.monitorenter.gui.chart.ITracePoint2D)public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int getMaxSize()
ITrace2D
Returns the maximum amount of ITracePoint2D instances that may be
added. For implementations that limit the maximum amount this is a
reasonable amount. Non-limiting implementations should return
Integer.MAX_VALUE. This allows to detect the unlimitedness. Of
course no implementation could store that amount of points.
ITracePoint2D instances that may be
added.ITrace2D.getMaxSize()public int getSize()
ITrace2DITracePoint2D instances currently contained.
ITracePoint2D instances
currently contained.ITrace2D.getSize()public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean isEmpty()
ITrace2DITracePoint2D instances are
contained or true if not.
ITracePoint2D
instances are contained or true if not.ITrace2D.isEmpty()public Iterator<ITracePoint2D> iterator()
ITrace2DIterator over the internal
ITrace2D instances.
Implementations should be synchronized. This method is meant to allow
modifications of the internal instances,
so the original points should be returned.
ITracePoint2D
There is no guarantee that changes made to the contained tracepoints will
be reflected in the display immediately. The order the iterator returns the
instances decides how the
ITracePoint2DChart2D will paint the trace.
Iterator over the internal
ITracePoint2D instances.ITrace2D.iterator()public Iterator<ITracePoint2D> descendingIterator()
ITrace2DIterator over the internal
ITrace2D instances in reverse order.
Implementations should be synchronized. This method is meant to allow
modifications of the internal instances,
so the original points should be returned.
ITracePoint2D
There is no guarantee that changes made to the contained tracepoints will
be reflected in the display immediately. The order the iterator returns the
instances decides how the
ITracePoint2DChart2D will paint the trace.
Iterator over the internal
ITracePoint2D instances in descending order.ITrace2D.descendingIterator()protected void removeAllPointsInternal()
ATrace2DCollection used in the implementation.
No change events have to be fired, this is done by ATrace2D.
removeAllPointsInternal in class ATrace2DATrace2D.removeAllPointsInternal()protected ITracePoint2D removePointInternal(ITracePoint2D point)
ATrace2D
The returned point may be the same as the given. But some "computing"
traces like
will internally delete a different point and return that one.
Trace2DArithmeticMean
No property change events have to be fired by default. If this method
returns null the outer logic of the calling method
will perform bound checks
for the returned point and fire property changes for the properties
ATrace2D.removePoint(ITracePoint2D),
ITrace2D.PROPERTY_MAX_X,
ITrace2D.PROPERTY_MIN_X and
ITrace2D.PROPERTY_MAX_Y.
ITrace2D.PROPERTY_MIN_Y
In special cases - when additional modifications to the internal set of points take place (e.g. a further point get added) this method should return false (regardless whether the old point was really removed or not) and perform bound checks and fire the property changes as mentioned above "manually".
removePointInternal in class ATrace2Dpoint - the point to remove.ATrace2D.removePointInternal(info.monitorenter.gui.chart.ITracePoint2D)Copyright © 2017. All rights reserved.