org.jfree.chart.labels

Class StandardCategorySeriesLabelGenerator

public class StandardCategorySeriesLabelGenerator extends Object implements CategorySeriesLabelGenerator, Cloneable, PublicCloneable, Serializable

A standard series label generator for plots that use data from a CategoryDataset.
Field Summary
static StringDEFAULT_LABEL_FORMAT
The default item label format.
Constructor Summary
StandardCategorySeriesLabelGenerator()
Creates a default series label generator (uses DEFAULT_LABEL_FORMAT).
StandardCategorySeriesLabelGenerator(String format)
Creates a new series label generator.
Method Summary
Objectclone()
Returns an independent copy of the generator.
protected Object[]createItemArray(CategoryDataset dataset, int series)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
booleanequals(Object obj)
Tests this object for equality with an arbitrary object.
StringgenerateLabel(CategoryDataset dataset, int series)
Generates a label for the specified series.

Field Detail

DEFAULT_LABEL_FORMAT

public static final String DEFAULT_LABEL_FORMAT
The default item label format.

Constructor Detail

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 Detail

clone

public Object clone()
Returns an independent copy of the generator.

Returns: A clone.

Throws: CloneNotSupportedException if cloning is not supported.

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).

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.

Parameters: obj the other object (null permitted).

Returns: A boolean.

generateLabel

public String generateLabel(CategoryDataset dataset, int series)
Generates a label for the specified series.

Parameters: dataset the dataset (null not permitted). series the series.

Returns: A series label.