public abstract class TimeZoneNameProvider extends LocaleServiceProvider
TimeZone
类提供本地化的时区名称抽象类。本地化的时区名称可以从这个类的实现也为
DateFormatSymbols.getZoneStrings()
方法来源。
Modifier | Constructor and Description |
---|---|
protected |
TimeZoneNameProvider()
唯一的构造函数。
|
Modifier and Type | Method and Description |
---|---|
abstract String |
getDisplayName(String ID, boolean daylight, int style, Locale locale)
返回指定的时区标识的名称,该名称适用于在指定的区域设置给用户。
|
String |
getGenericDisplayName(String ID, int style, Locale locale)
返回指定的时区
ID 这适合呈现在指定的
locale 用户通用名称。
|
getAvailableLocales, isSupportedLocale
protected TimeZoneNameProvider()
public abstract String getDisplayName(String ID, boolean daylight, int style, Locale locale)
如果daylight
是真实的,该方法应该返回一个名字适合日光节约时间,即使指定的时区没有观察到日光节约时间在过去。
ID
-时区ID字符串
daylight
-如果是真的,回到夏令时的名字。
style
-
TimeZone.LONG
或
TimeZone.SHORT
locale
-所需的现场
IllegalArgumentException
-如果
style
无效,或
locale
没有一个回来的地方
getAvailableLocales()
。
NullPointerException
-如果
ID
或
locale
是空的
TimeZone.getDisplayName(boolean, int, java.util.Locale)
public String getGenericDisplayName(String ID, int style, Locale locale)
ID
这适合呈现在用户指定的
locale
总称。通用时区名称中性标准时间和夏令时。例如,“PT”是时区ID
America/Los_Angeles
短的通用名称,而其标准时间短,日光节约时间的名字是“科普”和“光动力疗法”,分别。参考
getDisplayName
有效时区ID。
此方法的默认实现将返回null
。
ID
-时区ID字符串
style
-
TimeZone.LONG
或
TimeZone.SHORT
locale
-所需的现场
null
如果不可用。
IllegalArgumentException
-如果
style
无效,或
locale
没有一个回来的地方
getAvailableLocales()
。
NullPointerException
-如果
ID
或
locale
是
null
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.