|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.text.Format | +--oracle.i18n.text.OraDateFormat
OraDateFormat is an abstract class to do locale sensitive formatting and parsing between datetime and string locale dependently. It supports Oracle datetime formatting behavior.
OraSimpleDateFormat
, Serialized FormNested Class Summary |
Nested classes inherited from class java.text.Format |
Format.Field |
Field Summary | |
static int |
ALL_FIELD Constant for ALL field alignment. |
static int |
AM_PM_FIELD Constant for AM_PM field alignment. |
protected Calendar |
calendar The calendar that this OraDateFormat uses to calculate the datetime field values. |
static int |
CENTRY_FIELD Constant for CENTRY field alignment. |
static int |
DATE_FIELD Constant for DATE field alignment. |
static int |
DAY_OF_WEEK_FIELD Constant for DAY_OF_WEEK field alignment. |
static int |
DAY_OF_YEAR_FIELD Constant for DAY_OF_YEAR field alignment. |
static int |
DEFAULT Constant for DEFAULT format. |
static int |
ERA_FIELD Constant for ERA field alignment. |
static int |
HOUR_FIELD Constant for HOUR field alignment Used in FieldPosition of formatting. |
static int |
HOUR_OF_DAY_FIELD Constant for HOUR_OF_DAY field alignment. |
static int |
ISO_WEEK_OF_YEAR_FIELD Constant for ISO_WEEK_OF_YEAR field alignment. |
static int |
ISO_YEAR_FIELD Constant for ISO_YEAR field alignment. |
static int |
JULIAN_DAY_FIELD Constant for JULIAN_DAY field alignment. |
static int |
LONG Constant for date/time LONG format style. |
static int |
MILLISECOND_FIELD Constant for MILLISECOND field alignment. |
static int |
MINUTE_FIELD Constant for MINUTE field alignment. |
static int |
MONTH_FIELD Constant for MONTH field alignment. |
static int |
QUARTER_OF_YEAR_FIELD Constant for QUARTER_OF_YEAR field alignment. |
static int |
SECOND_FIELD Constant for SECOND field alignment. |
static int |
SECONDS_FIELD Constant for SECONDS field alignment. |
static int |
SHORT Constant for date/time SHORT format style. |
static int |
TEXT_FIELD Constant for TEXT field alignment. |
static int |
TIMEZONE_FIELD Constant for TIMEZONE field alignment. |
static int |
WEEK_OF_MONTH_FIELD Constant for WEEK_OF_MONTH field alignment. |
static int |
WEEK_OF_YEAR_FIELD Constant for WEEK_OF_YEAR field alignment. |
static int |
YEAR_FIELD Constant for YEAR field alignment. |
Constructor Summary | |
OraDateFormat() |
Method Summary | |
Object |
clone() Overrides Cloneable. |
boolean |
equals(Object obj) Overrides equals. |
String |
format(Date date) Formats a Date into a datetime string. |
abstract StringBuffer |
format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats a Date into a datetime string. |
StringBuffer |
format(Object obj, StringBuffer toAppendTo, FieldPosition fieldPosition) Formats an Object into a datetime string. |
Calendar |
getCalendar() Returns the calendar associated with this datetime formatter. |
static oracle.i18n.text.OraDateFormat |
getDateInstance() Returns a date formatter that uses the DEFAULT date formatting style for the default locale. |
static oracle.i18n.text.OraDateFormat |
getDateInstance(int style) Returns a date formatter that uses the given date formatting style for the default locale. |
static oracle.i18n.text.OraDateFormat |
getDateInstance(int style, Locale locale) Returns a date formatter that uses the given date formatting style for the given locale. |
static oracle.i18n.text.OraDateFormat |
getDateInstance(int style, oracle.i18n.util.OraLocaleInfo localeInfo) Returns a date formatter that uses the given date formatting style for the given OraLocaleInfo. |
static oracle.i18n.text.OraDateFormat |
getDateTimeInstance() Returns a datetime formatter that uses the DEFAULT formatting style for the default locale. |
static oracle.i18n.text.OraDateFormat |
getDateTimeInstance(int dateStyle) Returns a datetime formatter that uses the given date formatting style and the default time formatting style for the default locale. |
static oracle.i18n.text.OraDateFormat |
getDateTimeInstance(int dateStyle, Locale locale) Returns a datetime formatter that uses the given date formatting style and the default time formatting style for the given locale. |
static oracle.i18n.text.OraDateFormat |
getDateTimeInstance(int dateStyle, oracle.i18n.util.OraLocaleInfo localeInfo) Returns a datetime formatter that uses the given date formatting style and the default time formatting style for the given OraLocaleInfo. |
static String |
getDefaultDateFormatPattern(int style, Locale locale) Returns the default date format pattern for the given date formatting style and the given locale. |
static String |
getDefaultDateFormatPattern(int style, oracle.i18n.util.OraLocaleInfo localeInfo) Returns the default date format pattern for the given date formatting style and the given OraLocaleInfo. |
static String |
getDefaultDateTimeFormatPattern(int dateStyle, Locale locale) Returns the default datetime format pattern for the given date formatting style and the given locale. |
static String |
getDefaultDateTimeFormatPattern(int dateStyle, oracle.i18n.util.OraLocaleInfo localeInfo) Returns the default datetime format pattern for the given date formatting style and the given OraLocaleInfo. |
static String |
getDefaultTimeFormatPattern(Locale locale) Returns the default time format pattern for the given locale. |
static String |
getDefaultTimeFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo) Returns the default time format pattern for the given OraLocaleInfo. |
static oracle.i18n.text.OraDateFormat |
getInstance() Returns a datetime formatter that uses the DEFAULT style for the default locale. |
static oracle.i18n.text.OraDateFormat |
getTimeInstance() Returns a time formatter for the default locale. |
static oracle.i18n.text.OraDateFormat |
getTimeInstance(Locale locale) Returns a time formatter for the given locale. |
static oracle.i18n.text.OraDateFormat |
getTimeInstance(oracle.i18n.util.OraLocaleInfo localeInfo) Returns a time formatter for the given OraLocaleInfo. |
TimeZone |
getTimeZone() Returns the timezone associated with the calendar of this formatter. |
Date |
parse(String text) Parses a datetime string into a Date. |
abstract Date |
parse(String text, ParsePosition pos) Parses a datetime string into a Date, starting from the given parse position. |
Object |
parseObject(String text, ParsePosition pos) Parses a datetime string into a (Date) Object, starting from the given parse position. |
void |
setCalendar(Calendar calendar) Sets the given calendar to be used by this datetime formatter. |
void |
setTimeZone(TimeZone timezone) Sets the given timezone to be used by the calendar of this formatter. |
Methods inherited from class java.text.Format |
format, formatToCharacterIterator, parseObject |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERA_FIELD
public static final int YEAR_FIELD
public static final int MONTH_FIELD
public static final int DATE_FIELD
public static final int HOUR_OF_DAY_FIELD
public static final int MINUTE_FIELD
public static final int SECOND_FIELD
public static final int MILLISECOND_FIELD
public static final int DAY_OF_WEEK_FIELD
public static final int DAY_OF_YEAR_FIELD
public static final int WEEK_OF_YEAR_FIELD
public static final int WEEK_OF_MONTH_FIELD
public static final int AM_PM_FIELD
public static final int HOUR_FIELD
public static final int TIMEZONE_FIELD
public static final int ALL_FIELD
public static final int CENTRY_FIELD
public static final int JULIAN_DAY_FIELD
public static final int QUARTER_OF_YEAR_FIELD
public static final int SECONDS_FIELD
public static final int TEXT_FIELD
public static final int ISO_YEAR_FIELD
public static final int ISO_WEEK_OF_YEAR_FIELD
public static final int SHORT
public static final int LONG
public static final int DEFAULT
protected Calendar calendar
Constructor Detail |
public OraDateFormat()
Method Detail |
public static final oracle.i18n.text.OraDateFormat getDateInstance()
public static final oracle.i18n.text.OraDateFormat getDateInstance(int style)
style
- the given date formatting style.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getDateInstance(int style, Locale locale)
style
- the given date formatting style.locale
- the given locale.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getDateInstance(int style, oracle.i18n.util.OraLocaleInfo localeInfo)
style
- the given date formatting style.localeInfo
- the given OraLocaleInfo.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getDateTimeInstance()
public static final oracle.i18n.text.OraDateFormat getDateTimeInstance(int dateStyle)
dateStyle
- the given date formatting style.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getDateTimeInstance(int dateStyle, Locale locale)
dateStyle
- the given date formatting style.locale
- the given locale.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getDateTimeInstance(int dateStyle, oracle.i18n.util.OraLocaleInfo localeInfo)
dateStyle
- the given date formatting style.localeInfo
- the given OraLocaleInfo.IllegalArgumentException
- if the given date formatting style is invalid.public static final oracle.i18n.text.OraDateFormat getInstance()
public static final oracle.i18n.text.OraDateFormat getTimeInstance()
public static final oracle.i18n.text.OraDateFormat getTimeInstance(Locale locale)
public static final oracle.i18n.text.OraDateFormat getTimeInstance(oracle.i18n.util.OraLocaleInfo localeInfo)
localeInfo
- the given OraLocaleInfo.public final String format(Date date)
date
- the datetime object to be formatted into a datetime string.public abstract StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition)
date
- the datetime object to be formatted into a datetime string.toAppendTo
- the string buffer to be appended with the formatted datetime string.fieldPosition
- 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.public final StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition fieldPosition)
format
in class Format
obj
- the object to be formatted into a datetime string. It must be an instance of Date or Number.toAppendTo
- the string buffer to be appended with the formatted datetime string.fieldPosition
- 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.IllegalArgumentException
- if the given object is neither an instance of Date nor an instance of Number.public Date parse(String text) throws ParseException
text
- the datetime string to be parsed.ParseException
- 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.public abstract Date parse(String text, ParsePosition pos)
text
- the datetime stringpos
- indicates where to start the parsing on input. On output, returns where the parse ends if parsing succeeds, or the start index if fails.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.public Object parseObject(String text, ParsePosition pos)
parseObject
in class Format
parse(String, ParsePosition).
public static String getDefaultDateFormatPattern(int style, Locale locale)
locale
- the given locale.IllegalArgumentException
- if the given date formatting style is invalid.public static String getDefaultDateFormatPattern(int style, oracle.i18n.util.OraLocaleInfo localeInfo)
localeInfo
- the given OraLocaleInfo.IllegalArgumentException
- if the given date formatting style is invalid.public static String getDefaultDateTimeFormatPattern(int dateStyle, Locale locale)
dateStyle
- the given date formatting style.locale
- the given locale.IllegalArgumentException
- if the given date formatting style is invalid.public static String getDefaultDateTimeFormatPattern(int dateStyle, oracle.i18n.util.OraLocaleInfo localeInfo)
dateStyle
- the given date formatting style.localeInfo
- the given OraLocaleInfo.IllegalArgumentException
- if the given date formatting style is invalid.public static String getDefaultTimeFormatPattern(Locale locale)
locale
- the given locale.public static String getDefaultTimeFormatPattern(oracle.i18n.util.OraLocaleInfo localeInfo)
localeInfo
- the given OraLocaleInfo.public Calendar getCalendar()
public void setCalendar(Calendar calendar)
calendar
- the given calendar to be used by this formatter.public TimeZone getTimeZone()
public void setTimeZone(TimeZone timezone)
timezone
- the given timezone to be used by the calendar of this formatter.public Object clone()
clone
in class Format
public boolean equals(Object obj)
equals
in class Object
|
Oracle® Globalization Development Kit Java API Reference 10g Release 1(10.1) B10971-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |