Module platform

Class StandardCategorySeriesLabelGenerator

java.lang.Object
org.jfree.chart.labels.StandardCategorySeriesLabelGenerator
All Implemented Interfaces:
Serializable, Cloneable, CategorySeriesLabelGenerator, PublicCloneable

public class StandardCategorySeriesLabelGenerator extends Object implements CategorySeriesLabelGenerator, Cloneable, PublicCloneable, Serializable
A standard series label generator for plots that use data from a CategoryDataset.
See Also:
  • Field Details

    • DEFAULT_LABEL_FORMAT

      public static final String DEFAULT_LABEL_FORMAT
      The default item label format.
      See Also:
  • Constructor Details

    • StandardCategorySeriesLabelGenerator

      public StandardCategorySeriesLabelGenerator()
      Creates a default series label generator (uses DEFAULT_LABEL_FORMAT).
    • StandardCategorySeriesLabelGenerator

      public StandardCategorySeriesLabelGenerator(String format)
      Creates a new series label generator.
      Parameters:
      format - the format pattern (null not permitted).
  • Method Details

    • generateLabel

      public String generateLabel(CategoryDataset dataset, int series)
      Generates a label for the specified series.
      Specified by:
      generateLabel in interface CategorySeriesLabelGenerator
      Parameters:
      dataset - the dataset (null not permitted).
      series - the series.
      Returns:
      A series label.
    • createItemArray

      protected Object[] createItemArray(CategoryDataset dataset, int series)
      Creates the array of items that can be passed to the MessageFormat class for creating labels.
      Parameters:
      dataset - the dataset (null not permitted).
      series - the series (zero-based index).
      Returns:
      The items (never null).
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns an independent copy of the generator.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if cloning is not supported.
    • equals

      public boolean equals(Object obj)
      Tests this object for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the other object (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.