JIDE 3.5.15

com.jidesoft.chart.model
Class SamplingModel

java.lang.Object
  extended by com.jidesoft.chart.model.AbstractDelegatingChartModel
      extended by com.jidesoft.chart.model.SamplingModel
All Implemented Interfaces:
AnnotatedChartModel, AnnotationModel, ChartModel, ChartModelListener, Named, Iterable<Chartable>

public class SamplingModel
extends AbstractDelegatingChartModel

A ChartModel that presents a reduced-size version of its delegate by sampling its data. A sampling rate of 10 means that only one in 10 points of the original data set appear in the points presented by this model. It therefore represents a 10-fold reduction in size.

Author:
Simon White (swhite@catalysoft.com)

Constructor Summary
SamplingModel()
           
SamplingModel(AnnotatedChartModel delegate)
           
 
Method Summary
 Annotation getAnnotation(int n)
          Gets the nth annotation.
 int getAnnotationCount()
          Returns the number of annotations
 Chartable getPoint(int n)
          Gets the nth point.
 int getPointCount()
          Gets the number of points in the data set
 int getSamplingRate()
           
 boolean isAnnotationsVisible()
          Use this method to discover whether annotations should be shown or hidden.
 void setAnnotationsVisible(boolean visible)
          Specify whether annotations should be shown
 void setSamplingRate(int samplingRate)
           
protected  void update()
           
 
Methods inherited from class com.jidesoft.chart.model.AbstractDelegatingChartModel
addChartModelListener, chartModelChanged, equals, fireModelChanged, getDelegate, getDelegate, getDelegates, getName, hashCode, init, isCyclical, iterator, removeChartModelListener, setDelegate, setDelegates, setDelegates, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingModel

public SamplingModel()

SamplingModel

public SamplingModel(AnnotatedChartModel delegate)
Method Detail

getSamplingRate

public int getSamplingRate()

setSamplingRate

public void setSamplingRate(int samplingRate)

getAnnotationCount

public int getAnnotationCount()
Description copied from interface: AnnotationModel
Returns the number of annotations

Specified by:
getAnnotationCount in interface AnnotationModel
Specified by:
getAnnotationCount in class AbstractDelegatingChartModel
Returns:
the number of annotations

getAnnotation

public Annotation getAnnotation(int n)
Description copied from interface: AnnotationModel
Gets the nth annotation.

Specified by:
getAnnotation in interface AnnotationModel
Specified by:
getAnnotation in class AbstractDelegatingChartModel
Parameters:
n - the index.
Returns:
the nth annotation

isAnnotationsVisible

public boolean isAnnotationsVisible()
Description copied from interface: AnnotationModel
Use this method to discover whether annotations should be shown or hidden.

Returns:
whether annotations should be shown

setAnnotationsVisible

public void setAnnotationsVisible(boolean visible)
Description copied from interface: AnnotationModel
Specify whether annotations should be shown

Parameters:
visible - whether annotations should be shown

getPoint

public Chartable getPoint(int n)
Description copied from interface: ChartModel
Gets the nth point. The first point has index 0.

Specified by:
getPoint in interface ChartModel
Specified by:
getPoint in class AbstractDelegatingChartModel
Parameters:
n - the index
Returns:
the nth point in the ChartModel.

getPointCount

public int getPointCount()
Description copied from interface: ChartModel
Gets the number of points in the data set

Specified by:
getPointCount in interface ChartModel
Specified by:
getPointCount in class AbstractDelegatingChartModel
Returns:
the number of points

update

protected void update()
Specified by:
update in class AbstractDelegatingChartModel

JIDE 3.5.15