com.ijchart.xychart.format
Class MillisecondsToDateFormatter

java.lang.Object
  extended by com.ijchart.xychart.format.MillisecondsToDateFormatter
All Implemented Interfaces:
IFormatter, java.io.Serializable

public class MillisecondsToDateFormatter
extends java.lang.Object
implements IFormatter, java.io.Serializable

Title: IJChart

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

A Formatter provides support for formatting milliseconds.

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 java.lang.String DATE_MASK_LONG
           The date mask of long type.
static java.lang.String DATE_MASK_SHORT
           The date mask of short type.
 
Constructor Summary
MillisecondsToDateFormatter(java.util.Locale locale, java.lang.String mask)
           Create a new MillisecondsToDateFormatter by a date mask.
MillisecondsToDateFormatter(java.lang.String mask)
           Create a new DateFormatter by default locale and a date mask.
 
Method Summary
 boolean equals(java.lang.Object obj)
           Tests this object for equality with an arbitrary object.
 java.lang.String format(java.lang.Object obj, int index)
           Formatted a java.util.Date object to a string.
 int hashCode()
           Returns a hash code.
 java.lang.String toString()
           Returns a string representation of this Range.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATE_MASK_LONG

public static final java.lang.String DATE_MASK_LONG
The date mask of long type.

See Also:
Constant Field Values

DATE_MASK_SHORT

public static final java.lang.String DATE_MASK_SHORT
The date mask of short type.

See Also:
Constant Field Values
Constructor Detail

MillisecondsToDateFormatter

public MillisecondsToDateFormatter(java.lang.String mask)
Create a new DateFormatter by default locale and a date mask.

Parameters:
mask - String A date mask.

MillisecondsToDateFormatter

public MillisecondsToDateFormatter(java.util.Locale locale,
                                   java.lang.String mask)
Create a new MillisecondsToDateFormatter by a date mask.

Parameters:
locale - Locale A java.util.Locale instance.
mask - String A date mask.
Method Detail

format

public java.lang.String format(java.lang.Object obj,
                               int index)
Formatted a java.util.Date object to a string. If a value is composed of a series of objects (such as the coordinates of the axis labels or scale value), the format could be based on index.Parameter index do not have to use, to use,extends this class.

Specified by:
format in interface IFormatter
Parameters:
obj - Object The object to be formatted (null permitted).
index - int The index value of a series objects. The first is at index 0, the next is at 1, and so on.This parameter is not used.
Returns:
String A formatted date string.

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.

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.