- java.lang.Object
-
- org.jfree.chart.labels.AbstractCategoryItemLabelGenerator
-
- org.jfree.chart.labels.StandardCategoryItemLabelGenerator
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,CategoryItemLabelGenerator
- Direct Known Subclasses:
IntervalCategoryItemLabelGenerator
public class StandardCategoryItemLabelGenerator extends AbstractCategoryItemLabelGenerator implements CategoryItemLabelGenerator, Cloneable, PublicCloneable, Serializable
A standard label generator that can be used with aCategoryItemRenderer.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_LABEL_FORMAT_STRINGThe default format string.
-
Constructor Summary
Constructors Constructor Description StandardCategoryItemLabelGenerator()Creates a new generator with a default number formatter.StandardCategoryItemLabelGenerator(String labelFormat, DateFormat formatter)Creates a new generator with the specified date formatter.StandardCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter)Creates a new generator with the specified number formatter.StandardCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter, NumberFormat percentFormatter)Creates a new generator with the specified number formatter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Tests this generator for equality with an arbitrary object.StringgenerateLabel(CategoryDataset dataset, int row, int column)Generates the label for an item in a dataset.inthashCode()Returns a hash code for this instance.-
Methods inherited from class org.jfree.chart.labels.AbstractCategoryItemLabelGenerator
clone, createItemArray, generateColumnLabel, generateLabelString, generateRowLabel, getDateFormat, getLabelFormat, getNumberFormat
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.labels.CategoryItemLabelGenerator
generateColumnLabel, generateRowLabel
-
Methods inherited from interface org.jfree.chart.api.PublicCloneable
clone
-
-
-
-
Field Detail
-
DEFAULT_LABEL_FORMAT_STRING
public static final String DEFAULT_LABEL_FORMAT_STRING
The default format string.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StandardCategoryItemLabelGenerator
public StandardCategoryItemLabelGenerator()
Creates a new generator with a default number formatter.
-
StandardCategoryItemLabelGenerator
public StandardCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter)
Creates a new generator with the specified number formatter.- Parameters:
labelFormat- the label format string (nullnot permitted).formatter- the number formatter (nullnot permitted).
-
StandardCategoryItemLabelGenerator
public StandardCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter, NumberFormat percentFormatter)
Creates a new generator with the specified number formatter.- Parameters:
labelFormat- the label format string (nullnot permitted).formatter- the number formatter (nullnot permitted).percentFormatter- the percent formatter (nullnot permitted).
-
StandardCategoryItemLabelGenerator
public StandardCategoryItemLabelGenerator(String labelFormat, DateFormat formatter)
Creates a new generator with the specified date formatter.- Parameters:
labelFormat- the label format string (nullnot permitted).formatter- the date formatter (nullnot permitted).
-
-
Method Detail
-
generateLabel
public String generateLabel(CategoryDataset dataset, int row, int column)
Generates the label for an item in a dataset. Note: in the current dataset implementation, each row is a series, and each column contains values for a particular category.- Specified by:
generateLabelin interfaceCategoryItemLabelGenerator- Parameters:
dataset- the dataset (nullnot permitted).row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The label (possibly
null).
-
equals
public boolean equals(Object obj)
Tests this generator for equality with an arbitrary object.- Overrides:
equalsin classAbstractCategoryItemLabelGenerator- Parameters:
obj- the object (nullpermitted).- Returns:
trueif this generator is equal toobj, andfalseotherwise.
-
hashCode
public int hashCode()
Description copied from class:AbstractCategoryItemLabelGeneratorReturns a hash code for this instance.- Overrides:
hashCodein classAbstractCategoryItemLabelGenerator- Returns:
- A hash code.
-
-