com.orsoncharts.label

## Class StandardXYZItemLabelGenerator

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

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

      public class StandardXYZItemLabelGenerator
      extends java.lang.Object
      implements XYZItemLabelGenerator, java.io.Serializable

  A default implementation of the `XYZItemLabelGenerator` interface. The implementation uses a `Formatter` instance to generate the item labels. Four values are passed to the formatter for possible inclusion in the resulting label: (1) the key for the series, (2) the x-value (3) the y-value and (4) the z-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 and Description
    --- | ---
    `static java.lang.String` | `COORDS_3DP_TEMPLATE` A label template that will display the (x, y, z) coordinates with 3 decimal places.
    `static java.lang.String` | `DEFAULT_TEMPLATE` The default label template.
    `static java.lang.String` | `KEY_AND_COORDS_3DP_TEMPLATE` A label template that will display the series key followed by the (x, y, z) coordinates with 3 decimal places.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardXYZItemLabelGenerator()` The default constructor.
    `StandardXYZItemLabelGenerator(java.lang.String template)` Creates a new instance with the specified label template.

  - ### 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` | `generateItemLabel(XYZDataset dataset, java.lang.Comparable<?> seriesKey, int itemIndex)` Generates a label for the specified data item.
    `XYZDataItemSelection` | `getItemSelection()` Returns the item selection (if this is non-`null`, labels will only be generated for the items in the selection).
    `int` | `hashCode()`
    `void` | `setItemSelection(XYZDataItemSelection selection)` Sets the item selection, which can be used to specify a subset of the data items that should have item labels generated.

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

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

- - ### Field Detail

    - #### KEY_AND_COORDS_3DP_TEMPLATE

          public static final java.lang.String KEY_AND_COORDS_3DP_TEMPLATE

      A label template that will display the series key followed by the (x, y, z) coordinates with 3 decimal places.
      See Also:
        Constant Field Values

    - #### COORDS_3DP_TEMPLATE

          public static final java.lang.String COORDS_3DP_TEMPLATE

      A label template that will display the (x, y, z) coordinates with 3 decimal places.
      See Also:
        Constant Field Values

    - #### DEFAULT_TEMPLATE

          public static final java.lang.String DEFAULT_TEMPLATE

      The default label template.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StandardXYZItemLabelGenerator

          public StandardXYZItemLabelGenerator()

      The default constructor.

    - #### StandardXYZItemLabelGenerator

          public StandardXYZItemLabelGenerator(java.lang.String template)

      Creates a new instance with the specified label template.
      Parameters:
        `template` - the label template (`null` not permitted).

  - ### Method Detail

    - #### getItemSelection

          public XYZDataItemSelection getItemSelection()

      Returns the item selection (if this is non-`null`, labels will only be generated for the items in the selection).
      Returns:
        The item selection (possibly `null`).

    - #### setItemSelection

          public void setItemSelection(XYZDataItemSelection selection)

      Sets the item selection, which can be used to specify a subset of the data items that should have item labels generated. If this is set to `null` then item labels will be generated for all items.
      Parameters:
        `selection` - the selection (`null` permitted).

    - #### generateItemLabel

          public java.lang.String generateItemLabel(XYZDataset dataset,
                                                    java.lang.Comparable<?> seriesKey,
                                                    int itemIndex)

      Generates a label for the specified data item.
      Specified by:
        `generateItemLabel` in interface `XYZItemLabelGenerator`
      Parameters:
        `dataset` - the dataset (`null` not permitted).
        `seriesKey` - the series key (`null` not permitted).
        `itemIndex` - the item index.
      Returns:
        The series 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`