com.filenet.wcm.toolkit.server.util
Class OptimizedDateFormat

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.OptimizedDateFormat

public class OptimizedDateFormat
extends java.lang.Object

OptimizedDateFormat is intended for use as a drop-in replacement for SimpleDateFormat.


Field Summary
protected static int DATE_STYLE_MODE
           
protected static int DATE_TIME_STYLE_MODE
           
protected  int dateStyle
           
protected static java.util.Hashtable fastDateFormats
           
protected  org.apache.commons.lang.time.FastDateFormat fdf
           
protected  java.util.Locale locale
           
protected  int mode
           
protected  java.lang.String pattern
           
protected static int PATTERN_MODE
           
protected  java.text.SimpleDateFormat sdf
           
protected static int TIME_STYLE_MODE
           
protected  int timeStyle
           
protected  java.util.TimeZone timeZone
           
protected static boolean useFastDateFormat
           
 
Constructor Summary
protected OptimizedDateFormat(int dateStyle, int timeStyle, java.util.Locale locale)
          Supports the static factory methods that follow.
  OptimizedDateFormat(java.lang.String pattern)
          Pattern-only constructor.
  OptimizedDateFormat(java.lang.String pattern, java.util.Locale locale)
          Pattern and Locale constructor.
 
Method Summary
 java.lang.String format(java.util.Date date)
          Matches the format method call from DateFormat.
static OptimizedDateFormat getDateInstance(int dateStyle, java.util.Locale locale)
          Gets an instance based on the numeric dateStyle value.
static OptimizedDateFormat getDateTimeInstance(int dateStyle, int timeStyle, java.util.Locale locale)
          Gets an instance based on the numeric dateStyle and timeStyle values.
static OptimizedDateFormat getTimeInstance(int timeStyle, java.util.Locale locale)
          Gets an instance based on the numeric timeStyle value.
protected  void initialize(int mode)
           
 java.util.Date parse(java.lang.String dateTimeString)
          Matches the parse method call from DateFormat.
 void setTimeZone(java.util.TimeZone timeZone)
          Matches setTimeZone call on DateFormat.
static void setUseFastDateFormat(boolean value)
           
 java.lang.String toLocalizedPattern()
          Matches SimpleDateFormat toLocalizedPattern() method.
 java.lang.String toPattern()
          Matches SimpleDateFormat toPattern() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fdf

protected org.apache.commons.lang.time.FastDateFormat fdf

sdf

protected java.text.SimpleDateFormat sdf

pattern

protected java.lang.String pattern

locale

protected java.util.Locale locale

timeZone

protected java.util.TimeZone timeZone

dateStyle

protected int dateStyle

timeStyle

protected int timeStyle

mode

protected int mode

PATTERN_MODE

protected static final int PATTERN_MODE
See Also:
Constant Field Values

DATE_STYLE_MODE

protected static final int DATE_STYLE_MODE
See Also:
Constant Field Values

TIME_STYLE_MODE

protected static final int TIME_STYLE_MODE
See Also:
Constant Field Values

DATE_TIME_STYLE_MODE

protected static final int DATE_TIME_STYLE_MODE
See Also:
Constant Field Values

fastDateFormats

protected static java.util.Hashtable fastDateFormats

useFastDateFormat

protected static boolean useFastDateFormat
Constructor Detail

OptimizedDateFormat

public OptimizedDateFormat(java.lang.String pattern)
Pattern-only constructor. Matches a SimpleDateFormat constructor.

Parameters:
pattern -

OptimizedDateFormat

public OptimizedDateFormat(java.lang.String pattern,
                           java.util.Locale locale)
Pattern and Locale constructor. Matches a SimpleDateFormat constructor.

Parameters:
pattern -
locale -

OptimizedDateFormat

protected OptimizedDateFormat(int dateStyle,
                              int timeStyle,
                              java.util.Locale locale)
Supports the static factory methods that follow.

Parameters:
dateStyle -
timeStyle -
locale -
Method Detail

getDateInstance

public static OptimizedDateFormat getDateInstance(int dateStyle,
                                                  java.util.Locale locale)
Gets an instance based on the numeric dateStyle value. Matches the static sig on DateFormat.

Parameters:
dateStyle -
locale -
Returns:

getTimeInstance

public static OptimizedDateFormat getTimeInstance(int timeStyle,
                                                  java.util.Locale locale)
Gets an instance based on the numeric timeStyle value. Matches the static sig on DateFormat.

Parameters:
timeStyle -
locale -
Returns:

getDateTimeInstance

public static OptimizedDateFormat getDateTimeInstance(int dateStyle,
                                                      int timeStyle,
                                                      java.util.Locale locale)
Gets an instance based on the numeric dateStyle and timeStyle values. Matches the static sig on DateFormat.

Parameters:
timeStyle -
locale -
Returns:

setUseFastDateFormat

public static void setUseFastDateFormat(boolean value)

toPattern

public java.lang.String toPattern()
Matches SimpleDateFormat toPattern() method.

Returns:

toLocalizedPattern

public java.lang.String toLocalizedPattern()
Matches SimpleDateFormat toLocalizedPattern() method.

Returns:

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Matches setTimeZone call on DateFormat.

Parameters:
timeZone -

format

public java.lang.String format(java.util.Date date)
Matches the format method call from DateFormat.

Parameters:
date -
Returns:

parse

public java.util.Date parse(java.lang.String dateTimeString)
                     throws java.text.ParseException
Matches the parse method call from DateFormat.

Parameters:
dateTimeString -
Returns:
Throws:
java.text.ParseException

initialize

protected void initialize(int mode)


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.