net.sf.fikin.pojostate.format
Class SimpleDateFormatMs

java.lang.Object
  extended by java.text.Format
      extended by java.text.DateFormat
          extended by java.text.SimpleDateFormat
              extended by net.sf.fikin.pojostate.format.SimpleDateFormatMs
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SimpleDateFormatMs
extends java.text.SimpleDateFormat

Simple date format accepting long values (milliseconds) as well as java.util.Date. created on Jul 19, 2005

Since:
Version:
$Revision: 1.2 $
Author:
fiykov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.DateFormat
java.text.DateFormat.Field
 
Field Summary
 
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
 
Constructor Summary
SimpleDateFormatMs()
           
SimpleDateFormatMs(java.lang.String pattern)
          Constructs a SimpleDateFormatMs using the given pattern and the default date format symbols for the default locale.
SimpleDateFormatMs(java.lang.String pattern, java.text.DateFormatSymbols formatSymbols)
          Constructs a SimpleDateFormatMs using the given pattern and date format symbols.
SimpleDateFormatMs(java.lang.String pattern, java.util.Locale locale)
          Constructs a SimpleDateFormatMs using the given pattern and the default date format symbols for the given locale.
 
Method Summary
 java.lang.String format(long dateMs)
          Formats a Date into a date/time string.
 java.lang.String format(java.lang.Long dateMs)
          Formats a Date into a date/time string.
 
Methods inherited from class java.text.SimpleDateFormat
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, parse, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.DateFormat
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
 
Methods inherited from class java.text.Format
format, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDateFormatMs

public SimpleDateFormatMs()

SimpleDateFormatMs

public SimpleDateFormatMs(java.lang.String pattern)
Constructs a SimpleDateFormatMs using the given pattern and the default date format symbols for the default locale. Note: This constructor may not support all locales. For full coverage, use the factory methods in the DateFormat class.

Parameters:
pattern - the pattern describing the date and time format
Throws:
java.lang.NullPointerException - if the given pattern is null
java.lang.IllegalArgumentException - if the given pattern is invalid

SimpleDateFormatMs

public SimpleDateFormatMs(java.lang.String pattern,
                          java.util.Locale locale)
Constructs a SimpleDateFormatMs using the given pattern and the default date format symbols for the given locale. Note: This constructor may not support all locales. For full coverage, use the factory methods in the DateFormat class.

Parameters:
pattern - the pattern describing the date and time format
locale - the locale whose date format symbols should be used
Throws:
java.lang.NullPointerException - if the given pattern is null
java.lang.IllegalArgumentException - if the given pattern is invalid

SimpleDateFormatMs

public SimpleDateFormatMs(java.lang.String pattern,
                          java.text.DateFormatSymbols formatSymbols)
Constructs a SimpleDateFormatMs using the given pattern and date format symbols.

Parameters:
pattern - the pattern describing the date and time format
formatSymbols - the date format symbols to be used for formatting
Throws:
java.lang.NullPointerException - if the given pattern or formatSymbols is null
java.lang.IllegalArgumentException - if the given pattern is invalid
Method Detail

format

public final java.lang.String format(long dateMs)
Formats a Date into a date/time string.

Parameters:
dateMs - the time value to be formatted into a time string as milliseconds
Returns:
the formatted time string.

format

public final java.lang.String format(java.lang.Long dateMs)
Formats a Date into a date/time string.

Parameters:
dateMs - the time value to be formatted into a time string as milliseconds
Returns:
the formatted time string.


Copyright © 2005 Nikolay Fiykov. All Rights Reserved.