Package org.jfree.chart.labels
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:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description StandardCrosshairLabelGenerator()Creates a new instance with default attributes.StandardCrosshairLabelGenerator(String labelTemplate, NumberFormat numberFormat)Creates a new instance with the specified attributes. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)Tests this generator for equality with an arbitrary object.StringgenerateLabel(Crosshair crosshair)Returns a string that can be used as the label for a crosshair.StringgetLabelTemplate()Returns the label template string.NumberFormatgetNumberFormat()Returns the number formatter.inthashCode()Returns a hash code for this instance.
-
Constructor Details
-
StandardCrosshairLabelGenerator
public StandardCrosshairLabelGenerator()Creates a new instance with default attributes. -
StandardCrosshairLabelGenerator
Creates a new instance with the specified attributes.- Parameters:
labelTemplate- the label template (nullnot permitted).numberFormat- the number formatter (nullnot permitted).
-
-
Method Details
-
getLabelTemplate
Returns the label template string.- Returns:
- The label template string (never
null).
-
getNumberFormat
Returns the number formatter.- Returns:
- The formatter (never
null).
-
generateLabel
Returns a string that can be used as the label for a crosshair.- Specified by:
generateLabelin interfaceCrosshairLabelGenerator- Parameters:
crosshair- the crosshair (nullnot permitted).- Returns:
- The label (possibly
null).
-
equals
Tests this generator for equality with an arbitrary object. -
hashCode
Returns a hash code for this instance.
-