Package org.jfree.chart.labels
Class StandardFlowLabelGenerator
- java.lang.Object
-
- org.jfree.chart.labels.StandardFlowLabelGenerator
-
- All Implemented Interfaces:
java.io.Serializable,FlowLabelGenerator
public class StandardFlowLabelGenerator extends java.lang.Object implements FlowLabelGenerator, java.io.Serializable
Standard flow label generator. Instances of this class are immutable.- Since:
- 1.5.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_TEMPLATEThe default template for formatting the label.private java.lang.StringtemplateThe template.
-
Constructor Summary
Constructors Constructor Description StandardFlowLabelGenerator()Creates a new instance with the default template.StandardFlowLabelGenerator(java.lang.String template)Creates a new generator with the specified template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.java.lang.StringgenerateLabel(FlowDataset dataset, FlowKey key)Returns a label for the specified flow.inthashCode()
-
-
-
Field Detail
-
DEFAULT_TEMPLATE
public static final java.lang.String DEFAULT_TEMPLATE
The default template for formatting the label.- See Also:
- Constant Field Values
-
template
private java.lang.String template
The template.
-
-
Constructor Detail
-
StandardFlowLabelGenerator
public StandardFlowLabelGenerator()
Creates a new instance with the default template.
-
StandardFlowLabelGenerator
public StandardFlowLabelGenerator(java.lang.String template)
Creates a new generator with the specified template. The template is passed to a Java Formatter instance along with four arguments, the stage (an integer), the source (a String), the destination (a String) and the flow value (a Number).- Parameters:
template- the template (nullnot permitted).
-
-
Method Detail
-
generateLabel
public java.lang.String generateLabel(FlowDataset dataset, FlowKey key)
Returns a label for the specified flow.- Specified by:
generateLabelin interfaceFlowLabelGenerator- Parameters:
dataset- the flow dataset (nullnot permitted).key- the flow key (nullnot permitted).- Returns:
- The label (possibly
null).
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to test (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-