Module org.jfree.chart3d
Package org.jfree.chart3d.label

# Class StandardCategoryItemLabelGenerator

java.lang.Object
org.jfree.chart3d.label.StandardCategoryItemLabelGenerator

All Implemented Interfaces:
  `Serializable`, `CategoryItemLabelGenerator`

public class StandardCategoryItemLabelGenerator extends Object implements CategoryItemLabelGenerator, Serializable
A default implementation of the `CategoryItemLabelGenerator` interface. The implementation uses a `Formatter` instance to generate the labels. Four values are passed to the formatter: (1) the key for the series, (2) the row key, (3) the column key and (4) the data value.
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.3
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 `SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE`).
`static final String`
`KEYS_AND_VALUE_TEMPLATE`
A template string that will show the series, row and column keys plus the data value.
`static final String`
`SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE`
A template that shows the series key, column key and value (the row key is omitted because it is often the same as the series key).
`static final String`
`VALUE_TEMPLATE`
A template string that will show just the value (to 2 decimal places).

## Constructor Summary

Constructors
Constructor
Description
`StandardCategoryItemLabelGenerator()`
The default constructor.
`StandardCategoryItemLabelGenerator(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`
`generateItemLabel(CategoryDataset3D dataset, Comparable<?> seriesKey, Comparable<?> rowKey, Comparable<?> columnKey)`
Generates the item label for one data item in a category chart.
`KeyedValues3DItemSelection`
`getItemSelection()`
Returns the item selection.
`int`
`hashCode()`
`void`
`setItemSelection(StandardKeyedValues3DItemSelection selection)`
Sets the item selection (labels will be created by this generator only for data items that are contained in the collection).

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

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

## Field Details

### VALUE_TEMPLATE

public static final String VALUE_TEMPLATE
A template string that will show just the value (to 2 decimal places).

Since:
  1.3
See Also:
  - Constant Field Values

### KEYS_AND_VALUE_TEMPLATE

public static final String KEYS_AND_VALUE_TEMPLATE
A template string that will show the series, row and column keys plus the data value.

Since:
  1.3
See Also:
  - Constant Field Values

### SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE

public static final String SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE
A template that shows the series key, column key and value (the row key is omitted because it is often the same as the series key).

Since:
  1.3
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 `SERIES_AND_COLUMN_KEYS_AND_VALUE_TEMPLATE`).

Since:
  1.3
See Also:
  - Constant Field Values

## Constructor Details

### StandardCategoryItemLabelGenerator

public StandardCategoryItemLabelGenerator()
The default constructor.

### StandardCategoryItemLabelGenerator

public StandardCategoryItemLabelGenerator(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

### getItemSelection

public KeyedValues3DItemSelection getItemSelection()
Returns the item selection. The default value is `null`.

Returns:
  The item selection.
Since:
  1.3

### setItemSelection

public void setItemSelection(StandardKeyedValues3DItemSelection selection)
Sets the item selection (labels will be created by this generator only for data items that are contained in the collection). If you set the selection to `null` then the generator will create labels for all data items.

Parameters:
  `selection` - the selection (`null` permitted).

### generateItemLabel

public String generateItemLabel(CategoryDataset3D dataset, Comparable<?> seriesKey, Comparable<?> rowKey, Comparable<?> columnKey)
Generates the item label for one data item in a category chart.

Specified by:
  `generateItemLabel` in interface `CategoryItemLabelGenerator`
Parameters:
  `dataset` - the dataset (`null` not permitted).
  `seriesKey` - the series key (`null` not permitted).
  `rowKey` - the row key (`null` not permitted).
  `columnKey` - the column key (`null` not permitted).
Returns:
  The label (never `null` for this implementation).

### 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`