org.jscience.text
Class TimeFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.NumberFormat
          extended by org.jscience.text.TimeFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public final class TimeFormat
extends java.text.NumberFormat

The TimeFormat class formats a number as a date string, by first scaling the number and adding an offset, and then treating the result as a time in milliseconds.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.NumberFormat
java.text.NumberFormat.Field
 
Field Summary
 
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
 
Constructor Summary
TimeFormat(java.text.DateFormat dateFormat, double scale, long offset)
          Constructs a TimeFormat object.
 
Method Summary
 java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          DOCUMENT ME!
 java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
          DOCUMENT ME!
 java.lang.Number parse(java.lang.String text, java.text.ParsePosition parsePosition)
          DOCUMENT ME!
 
Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
 
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeFormat

public TimeFormat(java.text.DateFormat dateFormat,
                  double scale,
                  long offset)
Constructs a TimeFormat object.

Parameters:
dateFormat - DOCUMENT ME!
scale - DOCUMENT ME!
offset - in milliseconds.
Method Detail

format

public java.lang.StringBuffer format(double number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
DOCUMENT ME!

Specified by:
format in class java.text.NumberFormat
Parameters:
number - DOCUMENT ME!
toAppendTo - DOCUMENT ME!
pos - DOCUMENT ME!
Returns:
DOCUMENT ME!

format

public java.lang.StringBuffer format(long number,
                                     java.lang.StringBuffer toAppendTo,
                                     java.text.FieldPosition pos)
DOCUMENT ME!

Specified by:
format in class java.text.NumberFormat
Parameters:
number - DOCUMENT ME!
toAppendTo - DOCUMENT ME!
pos - DOCUMENT ME!
Returns:
DOCUMENT ME!

parse

public java.lang.Number parse(java.lang.String text,
                              java.text.ParsePosition parsePosition)
DOCUMENT ME!

Specified by:
parse in class java.text.NumberFormat
Parameters:
text - DOCUMENT ME!
parsePosition - DOCUMENT ME!
Returns:
DOCUMENT ME!