Class JRBaseValueDataset

All Implemented Interfaces:
Serializable, Cloneable, JRValueDataset, DatasetRunHolder, JRChartDataset, JRCloneable, JRElementDataset

public class JRBaseValueDataset extends JRBaseChartDataset implements JRValueDataset
An immutable version of a dataset that generates a single value. A value dataset is suitable for using with charts that show a single value against a potential range, such as meter chart or a thermometer chart.
Author:
Barry Klawans (bklawans@users.sourceforge.net)
See Also:
  • Field Details

    • valueExpression

      protected JRExpression valueExpression
      The expression that returns the single value contained in this dataset.
  • Constructor Details

    • JRBaseValueDataset

      public JRBaseValueDataset(JRChartDataset dataset)
      Construct a new dataset that is a copy of an existing one.
      Parameters:
      dataset - the dataset to copy
    • JRBaseValueDataset

      public JRBaseValueDataset(JRValueDataset dataset, JRBaseObjectFactory factory)
      Constructs a new dataset that is a copy of an existing one, and register all of the new dataset's expressions with the specified factory.
      Parameters:
      dataset - the datast to copy
      factory - the factory to register the new dataset's expressions with
  • Method Details

    • getValueExpression

      public JRExpression getValueExpression()
      Description copied from interface: JRValueDataset
      Returns the expression that indicates the value held by this dataset.
      Specified by:
      getValueExpression in interface JRValueDataset
      Returns:
      the expression that indicates the value held by this dataset
    • getDatasetType

      public byte getDatasetType()
      Description copied from interface: JRChartDataset
      Gets the dataset type. Must be one of the dataset type constants defined in this class.
      Specified by:
      getDatasetType in interface JRChartDataset
    • collectExpressions

      public void collectExpressions(JRExpressionCollector collector)
      Adds all the expression used by this plot with the specified collector. All collected expression that are also registered with a factory will be included with the report is compiled.
      Specified by:
      collectExpressions in interface JRElementDataset
      Overrides:
      collectExpressions in class JRBaseElementDataset
      Parameters:
      collector - the expression collector to use
    • validate

      public void validate(JRVerifier verifier)
      Description copied from interface: JRChartDataset
      Validates the dataset using a verifier.

      Broken rules are collected by the verifier.

      Specified by:
      validate in interface JRChartDataset
      Parameters:
      verifier - the verifier to use for validation
    • clone

      public Object clone()
      Specified by:
      clone in interface JRCloneable
      Overrides:
      clone in class JRBaseElementDataset