public class StandardCategoryLabelGenerator<S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>> extends java.lang.Object implements CategoryLabelGenerator<S,R,C>, java.io.Serializable
CategoryLabelGenerator interface.
The implementation uses a Formatter instance to generate
the labels. Three values are passed to the formatter: (1) the key for
the series, row or column, (2) the count for the number of
non-null items in the series, row or column (as an
Integer) and (3) the total of the non-null values
(as a Double).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TEMPLATE
The default template string (used in the default constructor, it is
equivalent to
KEY_ONLY_TEMPLATE). |
static java.lang.String |
KEY_ONLY_TEMPLATE
A template string that will show the series, row or column key only.
|
static java.lang.String |
TOTAL_TEMPLATE
A template string that will show the key followed by the data total
(for the series, row or column) in brackets, with zero decimal places.
|
static java.lang.String |
TOTAL_TEMPLATE_2DP
A template string that will show the key followed by the data total
(for the series, row or column) in brackets, with two decimal places.
|
| Constructor and Description |
|---|
StandardCategoryLabelGenerator()
The default constructor.
|
StandardCategoryLabelGenerator(java.lang.String template)
Creates a new instance with the specified template string (which will
be passed to a
java.util.Formatter instance when generating
labels). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this label generator for equality with an arbitrary object.
|
java.lang.String |
generateColumnLabel(CategoryDataset3D<S,R,C> dataset,
C columnKey)
Generates a label for one column in a
CategoryDataset3D. |
java.lang.String |
generateRowLabel(CategoryDataset3D<S,R,C> dataset,
R rowKey)
Generates a label for one row in a
CategoryDataset3D. |
java.lang.String |
generateSeriesLabel(CategoryDataset3D<S,R,C> dataset,
S seriesKey)
Generates the label for one series in a category chart.
|
int |
hashCode() |
public static final java.lang.String KEY_ONLY_TEMPLATE
public static final java.lang.String TOTAL_TEMPLATE
public static final java.lang.String TOTAL_TEMPLATE_2DP
public static final java.lang.String DEFAULT_TEMPLATE
KEY_ONLY_TEMPLATE).public StandardCategoryLabelGenerator()
public StandardCategoryLabelGenerator(java.lang.String template)
java.util.Formatter instance when generating
labels). See the class description for an explanation of the values
that are available for use in the template string.template - the template (null not permitted).public java.lang.String generateSeriesLabel(CategoryDataset3D<S,R,C> dataset, S seriesKey)
generateSeriesLabel in interface CategoryLabelGenerator<S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>>dataset - the dataset (null not permitted).seriesKey - the key (null not permitted).null for this implementation).public java.lang.String generateRowLabel(CategoryDataset3D<S,R,C> dataset, R rowKey)
CategoryDataset3D.generateRowLabel in interface CategoryLabelGenerator<S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>>dataset - the dataset (null not permitted).rowKey - the key (null not permitted).null).public java.lang.String generateColumnLabel(CategoryDataset3D<S,R,C> dataset, C columnKey)
CategoryDataset3D.generateColumnLabel in interface CategoryLabelGenerator<S extends java.lang.Comparable<S>,R extends java.lang.Comparable<R>,C extends java.lang.Comparable<C>>dataset - the dataset (null not permitted).columnKey - the key (null not permitted).null).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Object