Top Description Inners Fields Constructors Methods
com.ibm.icu.impl

public final Class CalendarUtil

extends Object
Class Inheritance
Imports
java.util.Locale, .Map, .MissingResourceException, .TreeMap, com.ibm.icu.util.ULocale, .UResourceBundle

Calendar utilities. Date/time format service classes in com.ibm.icu.text packages sometimes need to access calendar internal APIs. But calendar classes are in com.ibm.icu.util package, so the package local cannot be used. This class is added in com.ibm.icu.impl package for sharing some calendar internal code for calendar and date format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

Calendar type string, such as "gregorian"
getCalendarType
(ULocale
The locale
loc
)

Returns a calendar type for the given locale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CALKEYback to summary
private static final String CALKEY
DEFCALback to summary
private static final String DEFCAL

Constructor Detail

CalendarUtilback to summary
public CalendarUtil()

Method Detail

getCalendarTypeback to summary
public static String getCalendarType(ULocale loc)

Returns a calendar type for the given locale. When the given locale has calendar keyword, the value of calendar keyword is returned. Otherwise, the default calendar type for the locale is returned.

Parameters
loc:ULocale

The locale

Returns:String

Calendar type string, such as "gregorian"

com.ibm.icu.impl back to summary

private final Class CalendarUtil.CalendarPreferences

extends Sink
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CalendarUtil.CalendarPreferences
pack-priv Map<String, String>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv String
public void
put(UResource.Key
Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.
key
,
UResource.Value
Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.
value
,
boolean
true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.
noFallback
)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root).

Field Detail

INSTANCEback to summary
private static final CalendarUtil.CalendarPreferences INSTANCE
prefsback to summary
pack-priv Map<String, String> prefs

Constructor Detail

CalendarPreferencesback to summary
pack-priv CalendarPreferences()

Method Detail

getCalendarTypeForRegionback to summary
pack-priv String getCalendarTypeForRegion(String region)
putback to summary
public void put(UResource.Key key, UResource.Value value, boolean noFallback)

Implements abstract com.ibm.icu.impl.UResource.Sink.put.

Doc from com.ibm.icu.impl.UResource.Sink.put.

Called once for each bundle (child-parent-...-root). The value is normally an array or table resource, and implementations of this method normally iterate over the tree of resource items stored there.

Parameters
key:UResource.Key

Initially the key string of the enumeration-start resource. Empty if the enumeration starts at the top level of the bundle. Reuse for output values from Array and Table getters.

value:UResource.Value

Call getArray() or getTable() as appropriate. Then reuse for output values from Array and Table getters.

noFallback:boolean

true if the bundle has no parent; that is, its top-level table has the nofallback attribute, or it is the root bundle of a locale tree.

Annotations
@Override