com.orsoncharts.label

## Class StandardCategoryLabelGenerator

- java.lang.Object
- - com.orsoncharts.label.StandardCategoryLabelGenerator

- All Implemented Interfaces:
    CategoryLabelGenerator, java.io.Serializable

      public class StandardCategoryLabelGenerator
      extends java.lang.Object
      implements CategoryLabelGenerator, java.io.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 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 Summary

    Constructors
    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).

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 dataset, java.lang.Comparable<?> columnKey)` Generates a label for one column in a `CategoryDataset3D`.
    `java.lang.String` | `generateRowLabel(CategoryDataset3D dataset, java.lang.Comparable<?> rowKey)` Generates a label for one row in a `CategoryDataset3D`.
    `java.lang.String` | `generateSeriesLabel(CategoryDataset3D dataset, java.lang.Comparable<?> 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 Detail

    - #### KEY_ONLY_TEMPLATE

          public static final java.lang.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 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.
      See Also:
        Constant Field Values

    - #### TOTAL_TEMPLATE_2DP

          public static final 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.
      See Also:
        Constant Field Values

    - #### DEFAULT_TEMPLATE

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

    - #### StandardCategoryLabelGenerator

          public StandardCategoryLabelGenerator()

      The default constructor.

    - #### StandardCategoryLabelGenerator

          public 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). 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 Detail

    - #### generateSeriesLabel

          public java.lang.String generateSeriesLabel(CategoryDataset3D dataset,
                                                      java.lang.Comparable<?> seriesKey)

      Generates the label for one series in a category chart.
      Specified by:
        `generateSeriesLabel` in interface `CategoryLabelGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `seriesKey` - the key (`null` not permitted).
      Returns:
        The label (never `null` for this implementation).

    - #### generateRowLabel

          public java.lang.String generateRowLabel(CategoryDataset3D dataset,
                                                   java.lang.Comparable<?> rowKey)

      Generates a label for one row in a `CategoryDataset3D`.
      Specified by:
        `generateRowLabel` in interface `CategoryLabelGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `rowKey` - the key (`null` not permitted).
      Returns:
        The row label (possibly `null`).

    - #### generateColumnLabel

          public java.lang.String generateColumnLabel(CategoryDataset3D dataset,
                                                      java.lang.Comparable<?> columnKey)

      Generates a label for one column in a `CategoryDataset3D`.
      Specified by:
        `generateColumnLabel` in interface `CategoryLabelGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `columnKey` - the key (`null` not permitted).
      Returns:
        The column label (possibly `null`).

    - #### equals

          public boolean equals(java.lang.Object obj)

      Tests this label generator for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object (`null` permitted).
      Returns:
        A boolean.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`