Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

oracle.i18n.text
Class OraSimpleDateFormat

java.lang.Object
  |
  +--java.text.Format
        |
        +--oracle.i18n.text.OraDateFormat
              |
              +--oracle.i18n.text.OraSimpleDateFormat
All Implemented Interfaces:
Cloneable, Serializable

public class OraSimpleDateFormat
extends OraDateFormat

OraSimpleDateFormat is an concrete class to do locale sensitive formatting and parsing between datetime and string. It supports Oracle datetime formatting behavior.

See Also:
OraDateFormat, Serialized Form

Nested Class Summary

 

Nested classes 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()
          Constructs an OraSimpleDateFormat object that uses the DEFAULT datetime formatting sytle for the default locale.
OraSimpleDateFormat(String pattern)
          Constructs an OraSimpleDateFormat object that uses the given format pattern for the default locale.
OraSimpleDateFormat(String pattern, Locale locale)
          Constructs an OraSimpleDateFormat object that uses the given format pattern for the given locale.
OraSimpleDateFormat(String pattern, oracle.i18n.text.OraDateFormatSymbols symbols)
          Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the default locale.
OraSimpleDateFormat(String pattern, oracle.i18n.text.OraDateFormatSymbols symbols, Locale locale)
          Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the given locale.
OraSimpleDateFormat(String pattern, oracle.i18n.text.OraDateFormatSymbols symbols, oracle.i18n.util.OraLocaleInfo localeInfo)
          Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the given OraLocaleInfo.
OraSimpleDateFormat(String pattern, oracle.i18n.util.OraLocaleInfo localeInfo)
          Constructs an OraSimpleDateFormat object that uses the given format pattern for the given OraLocaleInfo.

 

Method Summary
 void applyPattern(String pattern)
          Applys the given format pattern this datetime formatter.
 Object clone()
          Overrides cloneable.
 boolean equals(Object object)
          Overrides equals.
 StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
          Formats a Date into a datetime string.
 Locale getLocale()
          Returns the locale associated with this datetime formatter.
 oracle.i18n.text.OraDateFormatSymbols getOraDateFormatSymbols()
          Returns the Oracle datetime format symbols or translations used in this formatter.
 int hashCode()
          Overrides hashCode.
 Date parse(String text, ParsePosition pos)
          Parses a datetime string into a Date, starting from the given parse position.
 void setOraDateFormatSymbols(oracle.i18n.text.OraDateFormatSymbols sym)
          Sets the Oracle datetime format symbols or translations to the given OraDateFormatSymbols for this formatter.
 String toPattern()
          Returns the format pattern associated with this datetime 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()
Constructs an OraSimpleDateFormat object that uses the DEFAULT datetime formatting sytle for the default locale.

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern)
                    throws ParseException
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,
                           oracle.i18n.util.OraLocaleInfo localeInfo)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern for the given OraLocaleInfo.
Parameters:
pattern - the given format pattern.
localeInfo - the given OraLocaleInfo.
Throws:
ParseException - if the format pattern is invalid.

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern,
                           oracle.i18n.text.OraDateFormatSymbols symbols)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the default locale.
Parameters:
pattern - the given format pattern.
symbols - the given Oracle datetime symbols.
Throws:
ParseException - if the format pattern is invalid.

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern,
                           oracle.i18n.text.OraDateFormatSymbols symbols,
Locale locale)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the given locale.
Parameters:
pattern - the given format pattern.
symbols - the given Oracle datetime symbols.
locale - the given locale.
Throws:
ParseException - if the format pattern is invalid.

OraSimpleDateFormat

public OraSimpleDateFormat(String pattern,
                           oracle.i18n.text.OraDateFormatSymbols symbols,
                           oracle.i18n.util.OraLocaleInfo localeInfo)
                    throws ParseException
Constructs an OraSimpleDateFormat object that uses the given format pattern and the given Oracle datetime symbols for the given OraLocaleInfo.
Parameters:
pattern - the given format pattern.
symbols - the given Oracle datetime symbols.
localeInfo - the given OraLocaleInfo.
Throws:
ParseException - if the format pattern is invalid.
Method Detail

applyPattern

public void applyPattern(String pattern)
                  throws ParseException
Applys the given format pattern this datetime 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 into a datetime string. Sets field position if needed.
Specified by:
format in class OraDateFormat
Parameters:
date - the datetime object to be formatted into a datetime string.
toAppendTo - the string buffer to be appended with the formatted datetime 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 to be returned. On output: the offsets of the alignment field in the returned string buffer.
Returns:
the string buffer appended with the formatted datatime string.

getOraDateFormatSymbols

public oracle.i18n.text.OraDateFormatSymbols getOraDateFormatSymbols()
Returns the Oracle datetime 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 meridian indicators
Returns:
an OracleDateFormatSymbols object
See Also:
OraDateFormatSymbols

setOraDateFormatSymbols

public void setOraDateFormatSymbols(oracle.i18n.text.OraDateFormatSymbols sym)
Sets the Oracle datetime format symbols or translations to the given OraDateFormatSymbols for this formatter.
Parameters:
sym - the given OraDateFormatSymbols

parse

public Date parse(String text,
ParsePosition pos)
Parses a datetime string into a Date, starting from the given parse position.
Specified by:
parse in class OraDateFormat
Parameters:
text - the datetime 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 fails.
Returns:
a Date.
Throws:
IllegalArgumentException - if the format pattern associated with this fromatter is not valid for parsing or the given datetime string can not be parsed into a Date.

toPattern

public String toPattern()
Returns the format pattern associated with this datetime formatter.
Returns:
a format pattern string.

getLocale

public Locale getLocale()
Returns the locale associated with this datetime formatter.
Returns:
a Java Locale object.

clone

public Object clone()
Overrides cloneable.
Overrides:
clone in class OraDateFormat

equals

public boolean equals(Object object)
Overrides equals.
Overrides:
equals in class OraDateFormat

hashCode

public int hashCode()
Overrides hashCode.
Overrides:
hashCode in class Object

Oracle® Globalization Development Kit Java API Reference
10g Release 1(10.1)

B10971-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.