Package org.jfree.chart.labels
Class StandardCategorySeriesLabelGenerator
- java.lang.Object
-
- org.jfree.chart.labels.StandardCategorySeriesLabelGenerator
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CategorySeriesLabelGenerator,PublicCloneable
public class StandardCategorySeriesLabelGenerator extends java.lang.Object implements CategorySeriesLabelGenerator, java.lang.Cloneable, PublicCloneable, java.io.Serializable
A standard series label generator for plots that use data from aCategoryDataset.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_LABEL_FORMATThe default item label format.private java.lang.StringformatPatternThe format pattern.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description StandardCategorySeriesLabelGenerator()Creates a default series label generator (usesDEFAULT_LABEL_FORMAT).StandardCategorySeriesLabelGenerator(java.lang.String format)Creates a new series label generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns an independent copy of the generator.protected java.lang.Object[]createItemArray(CategoryDataset dataset, int series)Creates the array of items that can be passed to theMessageFormatclass for creating labels.booleanequals(java.lang.Object obj)Tests this object for equality with an arbitrary object.java.lang.StringgenerateLabel(CategoryDataset dataset, int series)Generates a label for the specified series.inthashCode()Returns a hash code for this instance.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_LABEL_FORMAT
public static final java.lang.String DEFAULT_LABEL_FORMAT
The default item label format.- See Also:
- Constant Field Values
-
formatPattern
private java.lang.String formatPattern
The format pattern.
-
-
Constructor Detail
-
StandardCategorySeriesLabelGenerator
public StandardCategorySeriesLabelGenerator()
Creates a default series label generator (usesDEFAULT_LABEL_FORMAT).
-
StandardCategorySeriesLabelGenerator
public StandardCategorySeriesLabelGenerator(java.lang.String format)
Creates a new series label generator.- Parameters:
format- the format pattern (nullnot permitted).
-
-
Method Detail
-
generateLabel
public java.lang.String generateLabel(CategoryDataset dataset, int series)
Generates a label for the specified series.- Specified by:
generateLabelin interfaceCategorySeriesLabelGenerator- Parameters:
dataset- the dataset (nullnot permitted).series- the series.- Returns:
- A series label.
-
createItemArray
protected java.lang.Object[] createItemArray(CategoryDataset dataset, int series)
Creates the array of items that can be passed to theMessageFormatclass for creating labels.- Parameters:
dataset- the dataset (nullnot permitted).series- the series (zero-based index).- Returns:
- The items (never
null).
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns an independent copy of the generator.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if cloning is not supported.
-
equals
public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the other object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
-