com.ijchart.xychart.format
Class XYNumberChartDataFormatter

java.lang.Object
  extended by com.ijchart.xychart.format.AbstractChartDataFormatterAdapter
      extended by com.ijchart.xychart.format.XYNumberChartDataFormatter
All Implemented Interfaces:
IChartDataFormatter, java.io.Serializable, java.lang.Cloneable

public class XYNumberChartDataFormatter
extends AbstractChartDataFormatterAdapter
implements IChartDataFormatter, java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

A formatter class for XYNumberChartData chart data.

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 int XYNUMBER_FORMATTER_TYPE_X
           Show x value only.
static int XYNUMBER_FORMATTER_TYPE_XY
           Show (x,y) value.
static int XYNUMBER_FORMATTER_TYPE_Y
           Show y value only.
 
Constructor Summary
XYNumberChartDataFormatter(java.lang.String xMask, java.lang.String yMask, int formatType)
           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 format(IMatrixDataset dataset, int row, int column)
           Formatted an IChartData object to a string.
 int getFormatType()
           Returns the format type;
 java.text.DecimalFormat getXFormat()
           Returns the x-value format object.
 java.text.DecimalFormat getYFormat()
           Returns the y-value format object.
 int hashCode()
           Returns a hash code.
 java.lang.String toString()
           Returns a string representation of this Range.
 
Methods inherited from class com.ijchart.xychart.format.AbstractChartDataFormatterAdapter
format
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ijchart.xychart.format.IChartDataFormatter
format
 

Field Detail

XYNUMBER_FORMATTER_TYPE_X

public static final int XYNUMBER_FORMATTER_TYPE_X
Show x value only.

See Also:
Constant Field Values

XYNUMBER_FORMATTER_TYPE_Y

public static final int XYNUMBER_FORMATTER_TYPE_Y
Show y value only.

See Also:
Constant Field Values

XYNUMBER_FORMATTER_TYPE_XY

public static final int XYNUMBER_FORMATTER_TYPE_XY
Show (x,y) value.

See Also:
Constant Field Values
Constructor Detail

XYNumberChartDataFormatter

public XYNumberChartDataFormatter(java.lang.String xMask,
                                  java.lang.String yMask,
                                  int formatType)
Constructor.

Parameters:
xMask - String The x-value format mask (null not permitted).
yMask - String The y-value format mask (null not permitted).
formatType - int The format type,see XYNUMBER_FORMATTER_TYPE_X, XYNUMBER_FORMATTER_TYPE_Y,XYNUMBER_FORMATTER_TYPE_XY
Method Detail

getFormatType

public int getFormatType()
Returns the format type;

Returns:
int The format type;

getXFormat

public java.text.DecimalFormat getXFormat()
Returns the x-value format object.

Returns:
DecimalFormat The x-value format object.

getYFormat

public java.text.DecimalFormat getYFormat()
Returns the y-value format object.

Returns:
DecimalFormat The y-value format object.

format

public java.lang.String format(IMatrixDataset dataset,
                               int row,
                               int column)
Formatted an IChartData object to a string.

Specified by:
format in interface IChartDataFormatter
Overrides:
format in class AbstractChartDataFormatterAdapter
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 A string (maybe 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.