| java.lang.Object java.text.Format java.text.DateFormat
DateFormat | abstract public class DateFormat extends Format (Code) | | DateFormat is the abstract superclass of formats which format and parse
Dates.
|
Constructor Summary | |
protected | DateFormat() Constructs a new instance of DateFormat. |
Method Summary | |
public Object | clone() Answers a new instance of DateFormat with the same properties. | public boolean | equals(Object object) Compares the specified object to this DateFormat and answer if they are
equal. | final public StringBuffer | format(Object object, StringBuffer buffer, FieldPosition field) Formats the specified object into the specified StringBuffer using the
rules of this DateFormat. | final public String | format(Date date) Formats the specified Date using the rules of this DateFormat. | abstract public StringBuffer | format(Date date, StringBuffer buffer, FieldPosition field) Formats the specified Date into the specified StringBuffer using the
rules of this DateFormat. | public static Locale[] | getAvailableLocales() Gets the list of installed Locales which support DateFormat. | public Calendar | getCalendar() Answers the Calendar used by this DateFormat. | final public static DateFormat | getDateInstance() Answers a DateFormat instance for formatting and parsing dates in the
DEFAULT style for the default Locale. | final public static DateFormat | getDateInstance(int style) Answers a DateFormat instance for formatting and parsing dates in the
specified style for the default Locale. | final public static DateFormat | getDateInstance(int style, Locale locale) Answers a DateFormat instance for formatting and parsing dates in the
specified style for the specified Locale. | final public static DateFormat | getDateTimeInstance() Answers a DateFormat instance for formatting and parsing dates and times
in the DEFAULT style for the default Locale. | final public static DateFormat | getDateTimeInstance(int dateStyle, int timeStyle) Answers a DateFormat instance for the formatting and
parsing of both dates and times in the manner appropriate to the default
Locale. | final public static DateFormat | getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) Answers a DateFormat instance for formatting and parsing dates and times
in the specified styles for the specified Locale. | final public static DateFormat | getInstance() Answers a DateFormat instance for formatting and parsing dates and times
in the SHORT style for the default Locale. | public NumberFormat | getNumberFormat() Answers the NumberFormat used by this DateFormat. | static String | getStyleName(int style) | final public static DateFormat | getTimeInstance() Answers a DateFormat instance for formatting and parsing times in the
DEFAULT style for the default Locale. | final public static DateFormat | getTimeInstance(int style) Answers a DateFormat instance for formatting and parsing times in the
specified style for the default Locale. | final public static DateFormat | getTimeInstance(int style, Locale locale) Answers a DateFormat instance for formatting and parsing times in the
specified style for the specified Locale. | public TimeZone | getTimeZone() Answers the TimeZone of the Calendar used by this DateFormat. | public int | hashCode() Answers an integer hash code for the receiver. | public boolean | isLenient() Answers if the Calendar used by this DateFormat is lenient. | public Date | parse(String string) Parse a Date from the specified String using the rules of this
DateFormat. | abstract public Date | parse(String string, ParsePosition position) Parse a Date from the specified String starting at the index specified by
the ParsePosition. | public Object | parseObject(String string, ParsePosition position) Parse a Date from the specified String starting at the index specified by
the ParsePosition. | public void | setCalendar(Calendar cal) Sets the Calendar used by this DateFormat. | public void | setLenient(boolean value) Sets if the Calendar used by this DateFormat is lenient. | public void | setNumberFormat(NumberFormat format) Sets the NumberFormat used by this DateFormat. | public void | setTimeZone(TimeZone timezone) Sets the TimeZone of the Calendar used by this DateFormat. |
AM_PM_FIELD | final public static int AM_PM_FIELD(Code) | | Field constant.
|
DATE_FIELD | final public static int DATE_FIELD(Code) | | Field constant.
|
DAY_OF_WEEK_FIELD | final public static int DAY_OF_WEEK_FIELD(Code) | | Field constant.
|
DAY_OF_WEEK_IN_MONTH_FIELD | final public static int DAY_OF_WEEK_IN_MONTH_FIELD(Code) | | Field constant.
|
DAY_OF_YEAR_FIELD | final public static int DAY_OF_YEAR_FIELD(Code) | | Field constant.
|
DEFAULT | final public static int DEFAULT(Code) | | Format style constant.
|
ERA_FIELD | final public static int ERA_FIELD(Code) | | Field constant.
|
FULL | final public static int FULL(Code) | | Format style constant.
|
HOUR0_FIELD | final public static int HOUR0_FIELD(Code) | | Field constant.
|
HOUR1_FIELD | final public static int HOUR1_FIELD(Code) | | Field constant.
|
HOUR_OF_DAY0_FIELD | final public static int HOUR_OF_DAY0_FIELD(Code) | | Field constant.
|
HOUR_OF_DAY1_FIELD | final public static int HOUR_OF_DAY1_FIELD(Code) | | Field constant.
|
LONG | final public static int LONG(Code) | | Format style constant.
|
MEDIUM | final public static int MEDIUM(Code) | | Format style constant.
|
MILLISECOND_FIELD | final public static int MILLISECOND_FIELD(Code) | | Field constant.
|
MINUTE_FIELD | final public static int MINUTE_FIELD(Code) | | Field constant.
|
MONTH_FIELD | final public static int MONTH_FIELD(Code) | | Field constant.
|
SECOND_FIELD | final public static int SECOND_FIELD(Code) | | Field constant.
|
SHORT | final public static int SHORT(Code) | | Format style constant.
|
TIMEZONE_FIELD | final public static int TIMEZONE_FIELD(Code) | | Field constant.
|
WEEK_OF_MONTH_FIELD | final public static int WEEK_OF_MONTH_FIELD(Code) | | Field constant.
|
WEEK_OF_YEAR_FIELD | final public static int WEEK_OF_YEAR_FIELD(Code) | | Field constant.
|
YEAR_FIELD | final public static int YEAR_FIELD(Code) | | Field constant.
|
DateFormat | protected DateFormat()(Code) | | Constructs a new instance of DateFormat.
|
clone | public Object clone()(Code) | | Answers a new instance of DateFormat with the same properties.
a shallow copy of this DateFormat See Also: java.lang.Cloneable |
equals | public boolean equals(Object object)(Code) | | Compares the specified object to this DateFormat and answer if they are
equal. The object must be an instance of DateFormat with the same
properties.
Parameters: object - the object to compare with this object true if the specified object is equal to this DateFormat, falseotherwise See Also: DateFormat.hashCode |
format | final public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code) | | Formats the specified object into the specified StringBuffer using the
rules of this DateFormat. If the field specified by the FieldPosition is
formatted, set the begin and end index of the formatted field in the
FieldPosition.
Parameters: object - the object to format, must be a Date or a Number. If theobject is a Number, a Date is constructed using thelongValue() of the Number. Parameters: buffer - the StringBuffer Parameters: field - the FieldPosition the StringBuffer parameter buffer exception: IllegalArgumentException - when the object is not a Date or a Number |
format | final public String format(Date date)(Code) | | Formats the specified Date using the rules of this DateFormat.
Parameters: date - the Date to format the formatted String |
format | abstract public StringBuffer format(Date date, StringBuffer buffer, FieldPosition field)(Code) | | Formats the specified Date into the specified StringBuffer using the
rules of this DateFormat. If the field specified by the FieldPosition is
formatted, set the begin and end index of the formatted field in the
FieldPosition.
Parameters: date - the Date to format Parameters: buffer - the StringBuffer Parameters: field - the FieldPosition the StringBuffer parameter buffer |
getAvailableLocales | public static Locale[] getAvailableLocales()(Code) | | Gets the list of installed Locales which support DateFormat.
an array of Locale |
getCalendar | public Calendar getCalendar()(Code) | | Answers the Calendar used by this DateFormat.
a Calendar |
getDateInstance | final public static DateFormat getDateInstance()(Code) | | Answers a DateFormat instance for formatting and parsing dates in the
DEFAULT style for the default Locale.
a DateFormat |
getDateInstance | final public static DateFormat getDateInstance(int style)(Code) | | Answers a DateFormat instance for formatting and parsing dates in the
specified style for the default Locale.
Parameters: style - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT a DateFormat |
getDateInstance | final public static DateFormat getDateInstance(int style, Locale locale)(Code) | | Answers a DateFormat instance for formatting and parsing dates in the
specified style for the specified Locale.
Parameters: style - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT Parameters: locale - the Locale a DateFormat |
getDateTimeInstance | final public static DateFormat getDateTimeInstance()(Code) | | Answers a DateFormat instance for formatting and parsing dates and times
in the DEFAULT style for the default Locale.
a DateFormat |
getDateTimeInstance | final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle)(Code) | | Answers a DateFormat instance for the formatting and
parsing of both dates and times in the manner appropriate to the default
Locale.
Parameters: dateStyle - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT Parameters: timeStyle - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT a DateFormat |
getDateTimeInstance | final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)(Code) | | Answers a DateFormat instance for formatting and parsing dates and times
in the specified styles for the specified Locale.
Parameters: dateStyle - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT Parameters: timeStyle - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT Parameters: locale - the Locale a DateFormat |
getInstance | final public static DateFormat getInstance()(Code) | | Answers a DateFormat instance for formatting and parsing dates and times
in the SHORT style for the default Locale.
a DateFormat |
getNumberFormat | public NumberFormat getNumberFormat()(Code) | | Answers the NumberFormat used by this DateFormat.
a NumberFormat |
getTimeInstance | final public static DateFormat getTimeInstance()(Code) | | Answers a DateFormat instance for formatting and parsing times in the
DEFAULT style for the default Locale.
a DateFormat |
getTimeInstance | final public static DateFormat getTimeInstance(int style)(Code) | | Answers a DateFormat instance for formatting and parsing times in the
specified style for the default Locale.
Parameters: style - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT a DateFormat |
getTimeInstance | final public static DateFormat getTimeInstance(int style, Locale locale)(Code) | | Answers a DateFormat instance for formatting and parsing times in the
specified style for the specified Locale.
Parameters: style - one of SHORT, MEDIUM, LONG, FULL, or DEFAULT Parameters: locale - the Locale a DateFormat |
getTimeZone | public TimeZone getTimeZone()(Code) | | Answers the TimeZone of the Calendar used by this DateFormat.
a TimeZone |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Objects which are equal
answer the same value for this method.
the receiver's hash See Also: DateFormat.equals |
isLenient | public boolean isLenient()(Code) | | Answers if the Calendar used by this DateFormat is lenient.
true when the Calendar is lenient, false otherwise |
parse | public Date parse(String string) throws ParseException(Code) | | Parse a Date from the specified String using the rules of this
DateFormat.
Parameters: string - the String to parse the Date resulting from the parse exception: ParseException - when an error occurs during parsing |
parse | abstract public Date parse(String string, ParsePosition position)(Code) | | Parse a Date from the specified String starting at the index specified by
the ParsePosition. If the string is successfully parsed, the index of the
ParsePosition is updated to the index following the parsed text.
Parameters: string - the String to parse Parameters: position - the ParsePosition, updated on return with the index followingthe parsed text, or on error the index is unchanged and theerror index is set to the index where the error occurred the Date resulting from the parse, or null if there is an error |
parseObject | public Object parseObject(String string, ParsePosition position)(Code) | | Parse a Date from the specified String starting at the index specified by
the ParsePosition. If the string is successfully parsed, the index of the
ParsePosition is updated to the index following the parsed text.
Parameters: string - the String to parse Parameters: position - the ParsePosition, updated on return with the index followingthe parsed text, or on error the index is unchanged and theerror index is set to the index where the error occurred the Date resulting from the parse, or null if there is an error |
setCalendar | public void setCalendar(Calendar cal)(Code) | | Sets the Calendar used by this DateFormat.
Parameters: cal - the Calendar |
setLenient | public void setLenient(boolean value)(Code) | | Sets if the Calendar used by this DateFormat is lenient.
Parameters: value - true to set the Calendar to be lenient, false otherwise |
setNumberFormat | public void setNumberFormat(NumberFormat format)(Code) | | Sets the NumberFormat used by this DateFormat.
Parameters: format - the NumberFormat |
setTimeZone | public void setTimeZone(TimeZone timezone)(Code) | | Sets the TimeZone of the Calendar used by this DateFormat.
Parameters: timezone - the TimeZone |
Methods inherited from java.text.Format | public Object clone()(Code)(Java Doc) String convertPattern(String template, String fromChars, String toChars, boolean check)(Code)(Java Doc) final public String format(Object object)(Code)(Java Doc) abstract public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc) public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code)(Java Doc) static Object getInternalField(String fieldName, Object target)(Code)(Java Doc) public Object parseObject(String string) throws ParseException(Code)(Java Doc) abstract public Object parseObject(String string, ParsePosition position)(Code)(Java Doc) static boolean upTo(String string, ParsePosition position, StringBuffer buffer, char stop)(Code)(Java Doc) static boolean upToWithQuotes(String string, ParsePosition position, StringBuffer buffer, char stop, char start)(Code)(Java Doc)
|
|
|