public abstract class DateFormatProvider extends LocaleServiceProvider
DateFormat
类的具体实现抽象类。
Modifier | Constructor and Description |
---|---|
protected |
DateFormatProvider()
唯一的构造函数。
|
Modifier and Type | Method and Description |
---|---|
abstract DateFormat |
getDateInstance(int style, Locale locale)
返回一个新的
DateFormat 实例格式日期与给定的格式设置样式为指定的现场。
|
abstract DateFormat |
getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)
返回一个新的
DateFormat 实例格式的日期和时间与给定的格式设置样式为指定的现场。
|
abstract DateFormat |
getTimeInstance(int style, Locale locale)
返回一个新的
DateFormat 实例格式时间与给定的格式设置样式为指定的现场。
|
getAvailableLocales, isSupportedLocale
public abstract DateFormat getTimeInstance(int style, Locale locale)
DateFormat
实例格式时间与给定的格式设置样式为指定的现场。
style
-给定的格式设置样式。对
DateFormat.SHORT
,
DateFormat.MEDIUM
,
DateFormat.LONG
的任何一个,或
DateFormat.FULL
。
locale
-所需的现场。
IllegalArgumentException
-如果
style
是无效的,或者从
getAvailableLocales()
返回
locale
不一的地方。
NullPointerException
-如果
locale
是空的
DateFormat.getTimeInstance(int, java.util.Locale)
public abstract DateFormat getDateInstance(int style, Locale locale)
DateFormat
实例格式日期与给定的格式设置样式为指定的现场。
style
-给定的格式设置样式。对
DateFormat.SHORT
,
DateFormat.MEDIUM
,
DateFormat.LONG
的任何一个,或
DateFormat.FULL
。
locale
-所需的现场。
IllegalArgumentException
-如果
style
是无效的,或者从
getAvailableLocales()
返回
locale
不一的地方。
NullPointerException
-如果
locale
是空的
DateFormat.getDateInstance(int, java.util.Locale)
public abstract DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)
DateFormat
实例格式的日期和时间与给定的格式设置样式为指定的现场。
dateStyle
-给定的日期格式样式。对
DateFormat.SHORT
,
DateFormat.MEDIUM
,
DateFormat.LONG
的任何一个,或
DateFormat.FULL
。
timeStyle
-给定的时间格式设置样式。对
DateFormat.SHORT
,
DateFormat.MEDIUM
,
DateFormat.LONG
的任何一个,或
DateFormat.FULL
。
locale
-所需的现场。
IllegalArgumentException
-如果
dateStyle
或
timeStyle
是无效的,或者从
getAvailableLocales()
返回
locale
不一的地方。
NullPointerException
-如果
locale
是空的
DateFormat.getDateTimeInstance(int, int, java.util.Locale)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.