Module org.jfree.chart3d
Package org.jfree.chart3d.label
Class StandardCategoryLabelGenerator<S extends Comparable<S>,R extends Comparable<R>,C extends Comparable<C>>
java.lang.Object
org.jfree.chart3d.label.StandardCategoryLabelGenerator<S,R,C>
- All Implemented Interfaces:
Serializable
,CategoryLabelGenerator<S,
R, C>
public class StandardCategoryLabelGenerator<S extends Comparable<S>,R extends Comparable<R>,C extends Comparable<C>>
extends Object
implements CategoryLabelGenerator<S,R,C>, Serializable
A default implementation of the
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
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
).
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- Since:
- 1.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default template string (used in the default constructor, it is equivalent toKEY_ONLY_TEMPLATE
).static final String
A template string that will show the series, row or column key only.static final String
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 final String
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 Summary
ConstructorsConstructorDescriptionThe default constructor.StandardCategoryLabelGenerator
(String template) Creates a new instance with the specified template string (which will be passed to ajava.util.Formatter
instance when generating labels). -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this label generator for equality with an arbitrary object.generateColumnLabel
(CategoryDataset3D<S, R, C> dataset, C columnKey) Generates a label for one column in aCategoryDataset3D
.generateRowLabel
(CategoryDataset3D<S, R, C> dataset, R rowKey) Generates a label for one row in aCategoryDataset3D
.generateSeriesLabel
(CategoryDataset3D<S, R, C> dataset, S seriesKey) Generates the label for one series in a category chart.int
hashCode()
-
Field Details
-
KEY_ONLY_TEMPLATE
A template string that will show the series, row or column key only.- Since:
- 1.2
- See Also:
-
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.- See Also:
-
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.- See Also:
-
DEFAULT_TEMPLATE
The default template string (used in the default constructor, it is equivalent toKEY_ONLY_TEMPLATE
).- Since:
- 1.2
- See Also:
-
-
Constructor Details
-
StandardCategoryLabelGenerator
public StandardCategoryLabelGenerator()The default constructor. -
StandardCategoryLabelGenerator
Creates a new instance with the specified template string (which will be passed to ajava.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.- Parameters:
template
- the template (null
not permitted).
-
-
Method Details
-
generateSeriesLabel
Generates the label for one series in a category chart.- Specified by:
generateSeriesLabel
in interfaceCategoryLabelGenerator<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>> - Parameters:
dataset
- the dataset (null
not permitted).seriesKey
- the key (null
not permitted).- Returns:
- The label (never
null
for this implementation).
-
generateRowLabel
Generates a label for one row in aCategoryDataset3D
.- Specified by:
generateRowLabel
in interfaceCategoryLabelGenerator<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>> - Parameters:
dataset
- the dataset (null
not permitted).rowKey
- the key (null
not permitted).- Returns:
- The row label (possibly
null
).
-
generateColumnLabel
Generates a label for one column in aCategoryDataset3D
.- Specified by:
generateColumnLabel
in interfaceCategoryLabelGenerator<S extends Comparable<S>,
R extends Comparable<R>, C extends Comparable<C>> - Parameters:
dataset
- the dataset (null
not permitted).columnKey
- the key (null
not permitted).- Returns:
- The column label (possibly
null
).
-
equals
Tests this label generator for equality with an arbitrary object. -
hashCode
-