Module platform

Class StandardCrosshairLabelGenerator

java.lang.Object
org.jfree.chart.labels.StandardCrosshairLabelGenerator
All Implemented Interfaces:
Serializable, CrosshairLabelGenerator

public class StandardCrosshairLabelGenerator extends Object implements CrosshairLabelGenerator, Serializable
A default label generator.
See Also:
  • Constructor Details

    • StandardCrosshairLabelGenerator

      public StandardCrosshairLabelGenerator()
      Creates a new instance with default attributes.
    • StandardCrosshairLabelGenerator

      public StandardCrosshairLabelGenerator(String labelTemplate, NumberFormat numberFormat)
      Creates a new instance with the specified attributes.
      Parameters:
      labelTemplate - the label template (null not permitted).
      numberFormat - the number formatter (null not permitted).
  • Method Details

    • getLabelTemplate

      public String getLabelTemplate()
      Returns the label template string.
      Returns:
      The label template string (never null).
    • getNumberFormat

      public NumberFormat getNumberFormat()
      Returns the number formatter.
      Returns:
      The formatter (never null).
    • generateLabel

      public String generateLabel(Crosshair crosshair)
      Returns a string that can be used as the label for a crosshair.
      Specified by:
      generateLabel in interface CrosshairLabelGenerator
      Parameters:
      crosshair - the crosshair (null not permitted).
      Returns:
      The label (possibly null).
    • equals

      public boolean equals(Object obj)
      Tests this 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()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code for this instance.