public abstract class AAccumulationStrategy extends Object implements IAccumulationStrategy
AccumulationStrategyAmountOfPoints).
If a trace is sorted then accumulation may be done based on value regions.
Consider you have sorted ascending x values that have a high density of
tracepoints in certain regions but a very low density in other regions. If
you would accumulated just n consecutive points you would thin out the
regions with very little data points (low density) to become even less
precision in those large regions while the regions with high density only
loose little information. If you decide to split up the visible range in to
parts with same value-span then you can just accumulate depending on the
density of x values. You will not loose data in value-ranges with low
density but are able to drop lots of unnecessary values in high-density
areas (see
AccumulationStrategyXRangeWithRespectToDensity).
PropertyChangeEvent may be
fired to PropertyChangeListener instances that
register themselves with
addPropertyChangeListener(String, PropertyChangeListener).
|
|
|
|
When fired |
|---|---|---|---|---|
|
that changed |
, the old value |
, the new value |
was called. |
|
that changed |
, the old value |
, the new value |
was called on the current accumulation strategy. |
IAccumulationStrategy.AccumulationControlConsecutivePoints, IAccumulationStrategy.IAccumulationControl| Modifier and Type | Field and Description |
|---|---|
protected PropertyChangeSupport |
m_propertyChangeSupport
The instance that add support for firing
PropertyChangeEvents and maintaining
PropertyChangeListeners. |
static String |
PROPERTY_ACCUMULATION_FUNCTION
The property key defining the
property. |
| Constructor and Description |
|---|
AAccumulationStrategy(IAccumulationFunction accumulationFunction)
Constructor taking the accumulation function to use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Registers a property change listener that will be informed about changes of
the property identified by the given
propertyName. |
protected void |
firePropertyChange(String property,
Object oldvalue,
Object newvalue)
Fires a property change event to the registered listeners.
|
IAccumulationFunction |
getAccumulationFunction()
Returns the accumulationFunction.
|
abstract Iterator<ITracePoint2D> |
iterator(ITrace2D source,
int amountOfPoints)
Template method to return an iterator over accumulated points.
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Unregisters a property change listener that has been registered for
listening on all properties.
|
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener)
Removes a property change listener for listening on the given property.
|
IAccumulationFunction |
setAccumulationFunction(IAccumulationFunction accumulationFunction)
Sets the accumulationFunction to use for this strategy.
|
public static String PROPERTY_ACCUMULATION_FUNCTION
getAccumulationFunction() property. Use in
combination with
addPropertyChangeListener(String, PropertyChangeListener).protected PropertyChangeSupport m_propertyChangeSupport
PropertyChangeEvents and maintaining
PropertyChangeListeners.
public AAccumulationStrategy(IAccumulationFunction accumulationFunction)
accumulationFunction - the accumulation function to use.public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
IAccumulationStrategypropertyName.
addPropertyChangeListener in interface IAccumulationStrategypropertyName - the name of the property the listener is interested inlistener - a listener that will only be informed if the property identified
by the argument propertyName changesIAccumulationStrategy.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)protected final void firePropertyChange(String property, Object oldvalue, Object newvalue)
property - one of the PROPERTY_XXX constants defined in
AAccumulationStrategy.oldvalue - the old value of the property.newvalue - the new value of the property.public IAccumulationFunction getAccumulationFunction()
IAccumulationStrategygetAccumulationFunction in interface IAccumulationStrategyIAccumulationStrategy.getAccumulationFunction()public abstract Iterator<ITracePoint2D> iterator(ITrace2D source, int amountOfPoints)
IAccumulationStrategyiterator in interface IAccumulationStrategysource - the real points of this trace.amountOfPoints - would allow to filter out points to accumulate by just taking n
consecutive trace points.IAccumulationStrategy.iterator(info.monitorenter.gui.chart.ITrace2D, int)public void removePropertyChangeListener(PropertyChangeListener listener)
IAccumulationStrategyremovePropertyChangeListener in interface IAccumulationStrategylistener - a listener that will only be informed if the property identified
by the argument propertyName changesIAccumulationStrategy.removePropertyChangeListener(java.beans.PropertyChangeListener)public void removePropertyChangeListener(String property, PropertyChangeListener listener)
IAccumulationStrategyremovePropertyChangeListener in interface IAccumulationStrategyproperty - one of the constants with the PROPERTY_ prefix
defined in this class or subclasses.listener - the listener for this property change.IAccumulationStrategy.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)public IAccumulationFunction setAccumulationFunction(IAccumulationFunction accumulationFunction)
IAccumulationStrategysetAccumulationFunction in interface IAccumulationStrategyaccumulationFunction - the accumulationFunction to set.IAccumulationStrategy.setAccumulationFunction(info.monitorenter.gui.chart.IAccumulationFunction)Copyright © 2017. All rights reserved.