Package oracle.i18n.text
Class OraSimpleDateFormat
- java.lang.Object
-
- java.text.Format
-
- oracle.i18n.text.OraDateFormat
-
- oracle.i18n.text.OraSimpleDateFormat
-
- All Implemented Interfaces:
Serializable,Cloneable
public class OraSimpleDateFormat extends OraDateFormat
TheOraSimpleDateFormatclass is a concrete class to do locale-sensitive formatting and parsing between date/time and string. It supports Oracle date/time formatting behavior.- See Also:
OraDateFormat, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
-
Field Summary
-
Fields inherited from class oracle.i18n.text.OraDateFormat
ALL_FIELD, AM_PM_FIELD, calendar, CENTRY_FIELD, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, HOUR_FIELD, HOUR_OF_DAY_FIELD, ISO_WEEK_OF_YEAR_FIELD, ISO_YEAR_FIELD, JULIAN_DAY_FIELD, LONG, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, QUARTER_OF_YEAR_FIELD, SECOND_FIELD, SECONDS_FIELD, SHORT, TEXT_FIELD, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
-
-
Constructor Summary
Constructors Constructor Description OraSimpleDateFormat()Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, Locale)OraSimpleDateFormat(String pattern)Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, Locale)OraSimpleDateFormat(String pattern, Locale locale)Constructs anOraSimpleDateFormatobject that uses the given format pattern for the given locale.OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols)Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, OraDateFormatSymbols, Locale)OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols, Locale locale)Constructs anOraSimpleDateFormatobject that uses the given format pattern and the given Oracle date/time symbols for the given locale.OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols, OraLocaleInfo localeInfo)Constructs anOraSimpleDateFormatobject that uses the given format pattern and the given Oracle date/time symbols for the givenOraLocaleInfoobject.OraSimpleDateFormat(String pattern, OraLocaleInfo localeInfo)Constructs anOraSimpleDateFormatobject that uses the given format pattern for the givenOraLocaleInfoobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyPattern(String pattern)Applies the given format pattern of this date/time formatter.Objectclone()Overrides theclonemethod.booleanequals(Object object)Overrides theequalsmethod.StringBufferformat(Date date, StringBuffer toAppendTo, FieldPosition pos)Formats aDateobject into a date/time string.LocalegetLocale()Returns the locale associated with this date/time formatter.OraDateFormatSymbolsgetOraDateFormatSymbols()Returns the Oracle date/time format symbols or translations used in this formatter.inthashCode()Overrides thehashCodemethod.Dateparse(String text, ParsePosition pos)Parses a date/time string into aDateobject, starting from the given parse position.voidsetOraDateFormatSymbols(OraDateFormatSymbols sym)Sets the Oracle date/time format symbols or translations to the givenOraDateFormatSymbolsobject for this formatter.StringtoPattern()Returns the format pattern associated with this date/time formatter.-
Methods inherited from class oracle.i18n.text.OraDateFormat
format, format, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getDefaultDateFormatPattern, getDefaultDateFormatPattern, getDefaultDateTimeFormatPattern, getDefaultDateTimeFormatPattern, getDefaultTimeFormatPattern, getDefaultTimeFormatPattern, getInstance, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, parse, parseObject, setCalendar, setTimeZone
-
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
-
-
-
Constructor Detail
-
OraSimpleDateFormat
public OraSimpleDateFormat()
Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, Locale)Constructs anOraSimpleDateFormatobject that uses the default date/time formatting sytle for the default locale.
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern) throws ParseException
Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, Locale)Constructs anOraSimpleDateFormatobject that uses the given format pattern for the default locale.- Parameters:
pattern- the given format pattern- Throws:
ParseException- if the format pattern is invalid
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern, Locale locale) throws ParseException
Constructs anOraSimpleDateFormatobject that uses the given format pattern for the given locale.- Parameters:
pattern- the given format patternlocale- the given locale- Throws:
ParseException- if the format pattern is invalid
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern, OraLocaleInfo localeInfo) throws ParseException
Constructs anOraSimpleDateFormatobject that uses the given format pattern for the givenOraLocaleInfoobject.- Parameters:
pattern- the given format patternlocaleInfo- the givenOraLocaleInfoobject- Throws:
ParseException- if the format pattern is invalid
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols) throws ParseException
Deprecated.As of Oracle Database 10g Release 2 (10.2), replaced byOraSimpleDateFormat(String, OraDateFormatSymbols, Locale)Constructs anOraSimpleDateFormatobject that uses the given format pattern and the given Oracle date/time symbols for the default locale.- Parameters:
pattern- the given format patternsymbols- the given Oracle date/time symbols- Throws:
ParseException- if the format pattern is invalid
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols, Locale locale) throws ParseException
Constructs anOraSimpleDateFormatobject that uses the given format pattern and the given Oracle date/time symbols for the given locale.- Parameters:
pattern- the given format patternsymbols- the given Oracle date/time symbolslocale- the given locale- Throws:
ParseException- if the format pattern is invalid
-
OraSimpleDateFormat
public OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols, OraLocaleInfo localeInfo) throws ParseException
Constructs anOraSimpleDateFormatobject that uses the given format pattern and the given Oracle date/time symbols for the givenOraLocaleInfoobject.- Parameters:
pattern- the given format patternsymbols- the given Oracle date/time symbolslocaleInfo- the givenOraLocaleInfoobject- Throws:
ParseException- if the format pattern is invalid
-
-
Method Detail
-
applyPattern
public void applyPattern(String pattern) throws ParseException
Applies the given format pattern of this date/time formatter.- Parameters:
pattern- the given format pattern- Throws:
ParseException- if the format pattern is invalid
-
format
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
Formats aDateobject into a date/time string. Sets field position if needed.- Specified by:
formatin classOraDateFormat- Parameters:
date- the date/time object to be formatted.toAppendTo- the string buffer to be appended with the formatted date/time string.pos- to be used to get offsets of a given field in the returned string buffer. On input, the alignment field of which the offsets are to be returned. On output, the offsets of the alignment field in the returned string buffer.- Returns:
- the string buffer appended with the formatted date/time string
- Throws:
IllegalArgumentException- if any error occurs in the format operation
-
getOraDateFormatSymbols
public OraDateFormatSymbols getOraDateFormatSymbols()
Returns the Oracle date/time format symbols or translations used in this formatter. The symbols include: month names, abbreviated month names, names of day-of-the-week, abbreviated names of day-of-the-week, era strings, and meridian indicators.- Returns:
- an
OracleDateFormatSymbolsobject - See Also:
OraDateFormatSymbols
-
setOraDateFormatSymbols
public void setOraDateFormatSymbols(OraDateFormatSymbols sym)
Sets the Oracle date/time format symbols or translations to the givenOraDateFormatSymbolsobject for this formatter.- Parameters:
sym- the givenOraDateFormatSymbolsobject
-
parse
public Date parse(String text, ParsePosition pos)
Parses a date/time string into aDateobject, starting from the given parse position.- Specified by:
parsein classOraDateFormat- Parameters:
text- the date/time stringpos- indicates where to start the parsing on input. On output, returns where the parse ends if parsing succeeds, or the start index if it fails.- Returns:
- a
Dateobject - Throws:
IllegalArgumentException- if the format pattern associated with this formatter is not valid for parsing or the given date/time string cannot be parsed into aDateobject
-
toPattern
public String toPattern()
Returns the format pattern associated with this date/time formatter.- Returns:
- a format pattern string
-
getLocale
public Locale getLocale()
Returns the locale associated with this date/time formatter.- Returns:
- a Java
Localeobject
-
clone
public Object clone()
Overrides theclonemethod.- Overrides:
clonein classOraDateFormat- Returns:
- a cloned object
-
equals
public boolean equals(Object object)
Overrides theequalsmethod.- Overrides:
equalsin classOraDateFormat- Parameters:
object- an object to be compared- Returns:
trueif two objects are identical, otherwisefalse
-
-