Skip navigation links

Oracle® Database Globalization Development Kit Java API Reference
11g Release 1 (11.1)

Book Part Number B28299-01


oracle.i18n.text
Class OraSimpleDateFormat

java.lang.Object
  extended by java.text.Format
      extended by oracle.i18n.text.OraDateFormat
          extended by oracle.i18n.text.OraSimpleDateFormat

All Implemented Interfaces:
Serializable, Cloneable

public class OraSimpleDateFormat
extends OraDateFormat

The OraSimpleDateFormat class 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
OraSimpleDateFormat()
          Deprecated. As of Oracle Database 10g Release 2 (10.2), replaced by OraSimpleDateFormat.OraSimpleDateFormat(String, Locale)
OraSimpleDateFormat(String pattern)
          Deprecated. As of Oracle Database 10g Release 2 (10.2), replaced by OraSimpleDateFormat.OraSimpleDateFormat(String, Locale)
OraSimpleDateFormat(String pattern, Locale locale)
          Constructs an OraSimpleDateFormat object 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 by OraSimpleDateFormat.OraSimpleDateFormat(String, OraDateFormatSymbols, Locale)
OraSimpleDateFormat(String pattern, OraDateFormatSymbols symbols, Locale locale)
          Constructs an OraSimpleDateFormat object 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 an OraSimpleDateFormat object that uses the given format pattern and the given Oracle date/time symbols for the given OraLocaleInfo object.
OraSimpleDateFormat(String pattern, OraLocaleInfo localeInfo)
          Constructs an OraSimpleDateFormat object that uses the given format pattern for the given OraLocaleInfo object.

 

Method Summary
 void applyPattern(String pattern)
          Applies the given format pattern of this date/time formatter.
 Object clone()
          Overrides the clone method.
 boolean equals(Object object)
          Overrides the equals method.
 StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
          Formats a Date object into a date/time string.
 Locale getLocale()
          Returns the locale associated with this date/time formatter.
 OraDateFormatSymbols getOraDateFormatSymbols()
          Returns the Oracle date/time format symbols or translations used in this formatter.
 int hashCode()
          Overrides the hashCode method.
 Date parse(String text, ParsePosition pos)
          Parses a date/time string into a Date object, starting from the given parse position.
 void setOraDateFormatSymbols(OraDateFormatSymbols sym)
          Sets the Oracle date/time format symbols or translations to the given OraDateFormatSymbols object for this formatter.
 String toPattern()
          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

 

Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

OraSimpleDateFormat

public OraSimpleDateFormat()
Deprecated. As of Oracle Database 10g Release 2 (10.2), replaced by OraSimpleDateFormat.OraSimpleDateFormat(String, Locale)
Constructs an OraSimpleDateFormat object 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 by OraSimpleDateFormat.OraSimpleDateFormat(String, Locale)
Constructs an OraSimpleDateFormat object 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 an OraSimpleDateFormat object that uses the given format pattern for the given locale.
Parameters:
pattern - the given format pattern
locale - the given locale
Throws:
ParseException - if the format pattern is invalid

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern,
                           OraLocaleInfo localeInfo)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern for the given OraLocaleInfo object.
Parameters:
pattern - the given format pattern
localeInfo - the given OraLocaleInfo object
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 by OraSimpleDateFormat.OraSimpleDateFormat(String, OraDateFormatSymbols, Locale)
Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle date/time symbols for the default locale.
Parameters:
pattern - the given format pattern
symbols - 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 an OraSimpleDateFormat object that uses the given format pattern and the given Oracle date/time symbols for the given locale.
Parameters:
pattern - the given format pattern
symbols - the given Oracle date/time symbols
locale - the given locale
Throws:
ParseException - if the format pattern is invalid

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern,
                           OraDateFormatSymbols symbols,
                           OraLocaleInfo localeInfo)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle date/time symbols for the given OraLocaleInfo object.
Parameters:
pattern - the given format pattern
symbols - the given Oracle date/time symbols
localeInfo - the given OraLocaleInfo object
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 a Date object into a date/time string. Sets field position if needed.
Specified by:
format in class OraDateFormat
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 OracleDateFormatSymbols object
See Also:
OraDateFormatSymbols

setOraDateFormatSymbols

public void setOraDateFormatSymbols(OraDateFormatSymbols sym)
Sets the Oracle date/time format symbols or translations to the given OraDateFormatSymbols object for this formatter.
Parameters:
sym - the given OraDateFormatSymbols object

parse

public Date parse(String text,
                  ParsePosition pos)
Parses a date/time string into a Date object, starting from the given parse position.
Specified by:
parse in class OraDateFormat
Parameters:
text - the date/time string
pos - 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 Date object
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 a Date object

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 Locale object

clone

public Object clone()
Overrides the clone method.
Overrides:
clone in class OraDateFormat
Returns:
a cloned object

equals

public boolean equals(Object object)
Overrides the equals method.
Overrides:
equals in class OraDateFormat
Parameters:
object - an object to be compared
Returns:
true if two objects are identical, otherwise false

hashCode

public int hashCode()
Overrides the hashCode method.
Overrides:
hashCode in class Object
Returns:
a hash value

Skip navigation links

Oracle® Database Globalization Development Kit Java API Reference
11g Release 1 (11.1)

Book Part Number B28299-01


Copyright © 2003, 2007, Oracle. All rights reserved.