com.ijchart.xychart.label
Class DefaultLabelGenerator

java.lang.Object
  extended by com.ijchart.xychart.label.LabelGeneratorAdaptor
      extended by com.ijchart.xychart.label.DefaultLabelGenerator
All Implemented Interfaces:
ILabelGenerator, java.io.Serializable, java.lang.Cloneable

public class DefaultLabelGenerator
extends LabelGeneratorAdaptor
implements ILabelGenerator, java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

The default label generator,this class is immutable.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static boolean DEFAULT_LABEL_GENERATOR_GROUP
           The default flag controls whether or not the data type is group.
 
Constructor Summary
DefaultLabelGenerator()
           No argument constructor.
DefaultLabelGenerator(boolean group)
           Constructor.
DefaultLabelGenerator(IChartDataFormatter formatter)
           Constructor.
DefaultLabelGenerator(IChartDataFormatter formatter, boolean group)
           Constructor.
 
Method Summary
protected  java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Tests this object for equality with an arbitrary object.
 java.lang.String generateGroupLabel(IMatrixDataset dataset, int row, int column, int index)
           Returns this data formatter.
 int hashCode()
           Returns a hash code.
 boolean isGroup()
           The flag controls whether or not the data type is group.
 java.lang.String toString()
           Returns a string representation of this Range.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LABEL_GENERATOR_GROUP

public static final boolean DEFAULT_LABEL_GENERATOR_GROUP
The default flag controls whether or not the data type is group.

See Also:
Constant Field Values
Constructor Detail

DefaultLabelGenerator

public DefaultLabelGenerator()
No argument constructor.


DefaultLabelGenerator

public DefaultLabelGenerator(boolean group)
Constructor.

Parameters:
group - boolean The flag controls whether or not the data type is group.

DefaultLabelGenerator

public DefaultLabelGenerator(IChartDataFormatter formatter)
Constructor.

Parameters:
formatter - IChartDataFormatter The data formatter (null permitted).

DefaultLabelGenerator

public DefaultLabelGenerator(IChartDataFormatter formatter,
                             boolean group)
Constructor.

Parameters:
formatter - IChartDataFormatter The data formatter (null permitted).
group - boolean The flag controls whether or not the data type is group.
Method Detail

getFormatter

public IChartDataFormatter getFormatter()
Returns this data formatter.

Returns:
IChartDataFormatter The data formatter (maybe null).

isGroup

public boolean isGroup()
The flag controls whether or not the data type is group.

Specified by:
isGroup in interface ILabelGenerator
Overrides:
isGroup in class LabelGeneratorAdaptor
Returns:
boolean A boolean.

generateLabel

public java.lang.String generateLabel(IMatrixDataset dataset,
                                      int row,
                                      int column)
Generates a label for the specified item. The label is typically a formatted version of the data value, but any text can be used.

Specified by:
generateLabel in interface ILabelGenerator
Overrides:
generateLabel in class LabelGeneratorAdaptor
Parameters:
dataset - IMatrixDataset The dataset (null not permitted).
row - int The dataset row number,must be greater than or equal to 0.
column - int The dataset column number,must be greater than or equal to 0.
Returns:
String The label (possibly null).

generateGroupLabel

public java.lang.String generateGroupLabel(IMatrixDataset dataset,
                                           int row,
                                           int column,
                                           int index)
Generates a label for the specified item. The label is typically a formatted version of the data value, but any text can be used.

Specified by:
generateGroupLabel in interface ILabelGenerator
Overrides:
generateGroupLabel in class LabelGeneratorAdaptor
Parameters:
dataset - IMatrixDataset The dataset (null not permitted).
row - int The dataset row number,must be greater than or equal to 0.
column - int The dataset column number,must be greater than or equal to 0.
index - int The index of a dataset data.
Returns:
String The label (possibly null).

equals

public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to test against (null permitted).
Returns:
A boolean.

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code.

toString

public java.lang.String toString()
Returns a string representation of this Range.

Overrides:
toString in class java.lang.Object
Returns:
A String.