org.apache.jcs.utils.date
Class ThreadSafeSimpleDateFormat
java.lang.Object
java.text.Format
java.text.DateFormat
java.text.SimpleDateFormat
org.apache.jcs.utils.date.ThreadSafeSimpleDateFormat
- All Implemented Interfaces:
- Serializable, Cloneable
public class ThreadSafeSimpleDateFormat
- extends SimpleDateFormat
Thread Safe version of SimpleDateFormat
This class simply synchronizes format and parse for SimpleDateFormat.
- See Also:
- Serialized Form
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 |
Methods inherited from class java.text.SimpleDateFormat |
applyLocalizedPattern, applyPattern, clone, equals, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, 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 |
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat()
- Empty Constructor
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(String pattern)
- Parameters:
pattern
- the pattern describing the date and time format
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(String pattern,
boolean lenient)
- Parameters:
pattern
- the pattern describing the date and time formatlenient
- leniency option - if false, strictly valid dates are enforced
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(String pattern,
Locale locale)
- Parameters:
pattern
- the pattern describing the date and time formatlocale
- the locale whose date format symbols should be used.
ThreadSafeSimpleDateFormat
public ThreadSafeSimpleDateFormat(String pattern,
DateFormatSymbols formatSymbols)
- Parameters:
pattern
- the pattern describing the date and time formatformatSymbols
- the date format symbols to be used for formatting.
format
public StringBuffer format(Date date,
StringBuffer toAppendTo,
FieldPosition fieldPosition)
- Overrides:
format
in class SimpleDateFormat
- Parameters:
date
- datetoAppendTo
- buffer to append tofieldPosition
- field position
- Returns:
- a string buffer with more data in it
parse
public Date parse(String source,
ParsePosition pos)
- Overrides:
parse
in class SimpleDateFormat
- Parameters:
source
- sourcepos
- parse position
- Returns:
- date
Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.