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 `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:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_TEMPLATE`
The default template string (used in the default constructor, it is equivalent to `KEY_ONLY_TEMPLATE`).
`static final String`
`KEY_ONLY_TEMPLATE`
A template string that will show the series, row or column key only.
`static final 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 final 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 Summary

Constructors
Constructor
Description
`StandardCategoryLabelGenerator()`
The default constructor.
`StandardCategoryLabelGenerator(String template)`
Creates a new instance with the specified template string (which will be passed to a `java.util.Formatter` instance when generating labels).

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this label generator for equality with an arbitrary object.
`String`
`generateColumnLabel(CategoryDataset3D<S,R,C> dataset, C columnKey)`
Generates a label for one column in a `CategoryDataset3D`.
`String`
`generateRowLabel(CategoryDataset3D<S,R,C> dataset, R rowKey)`
Generates a label for one row in a `CategoryDataset3D`.
`String`
`generateSeriesLabel(CategoryDataset3D<S,R,C> dataset, S seriesKey)`
Generates the label for one series in a category chart.
`int`
`hashCode()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### KEY_ONLY_TEMPLATE

public static final String KEY_ONLY_TEMPLATE
A template string that will show the series, row or column key only.

Since:
  1.2
See Also:
  - Constant Field Values

### TOTAL_TEMPLATE

public static final 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.

See Also:
  - Constant Field Values

### TOTAL_TEMPLATE_2DP

public static final 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.

See Also:
  - Constant Field Values

### DEFAULT_TEMPLATE

public static final String DEFAULT_TEMPLATE
The default template string (used in the default constructor, it is equivalent to `KEY_ONLY_TEMPLATE`).

Since:
  1.2
See Also:
  - Constant Field Values

## Constructor Details

### StandardCategoryLabelGenerator

public StandardCategoryLabelGenerator()
The default constructor.

### StandardCategoryLabelGenerator

public StandardCategoryLabelGenerator(String template)
Creates a new instance with the specified template string (which will be passed to a `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.

Parameters:
  `template` - the template (`null` not permitted).

## Method Details

### generateSeriesLabel

public String generateSeriesLabel(CategoryDataset3D<S,R,C> dataset, S seriesKey)
Generates the label for one series in a category chart.

Specified by:
  `generateSeriesLabel` in interface `CategoryLabelGenerator<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

public String generateRowLabel(CategoryDataset3D<S,R,C> dataset, R rowKey)
Generates a label for one row in a `CategoryDataset3D`.

Specified by:
  `generateRowLabel` in interface `CategoryLabelGenerator<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

public String generateColumnLabel(CategoryDataset3D<S,R,C> dataset, C columnKey)
Generates a label for one column in a `CategoryDataset3D`.

Specified by:
  `generateColumnLabel` in interface `CategoryLabelGenerator<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

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

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`