com.filenet.wcm.toolkit.server.util

Class OptimizedDateFormat

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

  1. public class OptimizedDateFormat
  2. extends java.lang.Object
OptimizedDateFormat is intended for use as a drop-in replacement for SimpleDateFormat.

Field Summary

Modifier and Type Field and Description
  1. protected static
  2. int
DATE_STYLE_MODE
  1. protected static
  2. int
DATE_TIME_STYLE_MODE
  1. protected
  2. int
dateStyle
  1. protected static
  2. java.util.Hashtable
fastDateFormats
  1. protected
  2. org.apache.commons.lang.time.FastDateFormat
fdf
  1. protected
  2. java.util.Locale
locale
  1. protected
  2. int
mode
  1. protected
  2. java.lang.String
pattern
  1. protected static
  2. int
PATTERN_MODE
  1. protected
  2. java.text.SimpleDateFormat
sdf
  1. protected static
  2. int
TIME_STYLE_MODE
  1. protected
  2. int
timeStyle
  1. protected
  2. java.util.TimeZone
timeZone
  1. protected static
  2. boolean
useFastDateFormat

Constructor Summary

Modifier Constructor and Description
  1. protected
OptimizedDateFormat(int dateStyle,int timeStyle,java.util.Locale locale)
Supports the static factory methods that follow.
  1. (package private)
OptimizedDateFormat(java.lang.String pattern)
Pattern-only constructor.
  1. (package private)
OptimizedDateFormat(java.lang.String pattern,java.util.Locale locale)
Pattern and Locale constructor.

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
format(java.util.Date date)
Matches the format method call from DateFormat.
  1. static
  2. OptimizedDateFormat
getDateInstance(int dateStyle,java.util.Locale locale)
Gets an instance based on the numeric dateStyle value.
  1. static
  2. OptimizedDateFormat
getDateTimeInstance(int dateStyle,int timeStyle,java.util.Locale locale)
Gets an instance based on the numeric dateStyle and timeStyle values.
  1. static
  2. OptimizedDateFormat
getTimeInstance(int timeStyle,java.util.Locale locale)
Gets an instance based on the numeric timeStyle value.
  1. protected
  2. void
initialize(int mode)
  1. java.util.Date
parse(java.lang.String dateTimeString)
Matches the parse method call from DateFormat.
  1. void
setTimeZone(java.util.TimeZone timeZone)
Matches setTimeZone call on DateFormat.
  1. static
  2. void
setUseFastDateFormat(boolean value)
  1. java.lang.String
toLocalizedPattern()
Matches SimpleDateFormat toLocalizedPattern() method.
  1. 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

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

sdf

  1. protected java.text.SimpleDateFormat sdf

pattern

  1. protected java.lang.String pattern

locale

  1. protected java.util.Locale locale

timeZone

  1. protected java.util.TimeZone timeZone

dateStyle

  1. protected int dateStyle

timeStyle

  1. protected int timeStyle

mode

  1. protected int mode

PATTERN_MODE

  1. protected static final int PATTERN_MODE
See Also:

DATE_STYLE_MODE

  1. protected static final int DATE_STYLE_MODE
See Also:

TIME_STYLE_MODE

  1. protected static final int TIME_STYLE_MODE
See Also:

DATE_TIME_STYLE_MODE

  1. protected static final int DATE_TIME_STYLE_MODE
See Also:

fastDateFormats

  1. protected static java.util.Hashtable fastDateFormats

useFastDateFormat

  1. protected static boolean useFastDateFormat

Constructor Detail

OptimizedDateFormat

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

OptimizedDateFormat

  1. public OptimizedDateFormat(java.lang.String pattern,
  2. java.util.Locale locale)
Pattern and Locale constructor. Matches a SimpleDateFormat constructor.
Parameters:
pattern -
locale -

OptimizedDateFormat

  1. protected OptimizedDateFormat(int dateStyle,
  2. int timeStyle,
  3. java.util.Locale locale)
Supports the static factory methods that follow.
Parameters:
dateStyle -
timeStyle -
locale -

Method Detail

getDateInstance

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

getTimeInstance

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

getDateTimeInstance

  1. public static OptimizedDateFormat getDateTimeInstance( int dateStyle,
  2. int timeStyle,
  3. 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

  1. public static void setUseFastDateFormat( boolean value)

toPattern

  1. public java.lang.String toPattern( )
Matches SimpleDateFormat toPattern() method.
Returns:

toLocalizedPattern

  1. public java.lang.String toLocalizedPattern( )
Matches SimpleDateFormat toLocalizedPattern() method.
Returns:

setTimeZone

  1. public void setTimeZone(java.util.TimeZone timeZone)
Matches setTimeZone call on DateFormat.
Parameters:
timeZone -

format

  1. public java.lang.String format( java.util.Date date)
Matches the format method call from DateFormat.
Parameters:
date -
Returns:

parse

  1. public java.util.Date parse(java.lang.String dateTimeString)
  2. throws java.text.ParseException
Matches the parse method call from DateFormat.
Parameters:
dateTimeString -
Returns:
Throws:
java.text.ParseException

initialize

  1. protected void initialize(int mode)