Class CalendarData


  • public class CalendarData
    extends Object
    This class abstracts access to calendar (Calendar and DateFormat) data.
    • Constructor Detail

      • CalendarData

        public CalendarData​(ULocale loc,
                            String type)
        Construct a CalendarData from the given locale.
        Parameters:
        loc - locale to use. The 'calendar' keyword will be ignored.
        type - calendar type. NULL indicates the gregorian calendar. No default lookup is done.
    • Method Detail

      • get

        public ICUResourceBundle get​(String key)
        Load data for calendar. Note, this object owns the resources, do NOT call ures_close()!
        Parameters:
        key - Resource key to data
      • get

        public ICUResourceBundle get​(String key,
                                     String subKey)
        Load data for calendar. Note, this object owns the resources, do NOT call ures_close()! There is an implicit key of 'format' data is located in: "calendar/key/format/subKey" for example, calendar/dayNames/format/abbreviated
        Parameters:
        key - Resource key to data
        subKey - Resource key to data
      • get

        public ICUResourceBundle get​(String key,
                                     String contextKey,
                                     String subKey)
        Load data for calendar. Note, this object owns the resources, do NOT call ures_close()! data is located in: "calendar/key/contextKey/subKey" for example, calendar/dayNames/stand-alone/narrow
        Parameters:
        key - Resource key to data
        contextKey - Resource key to data
        subKey - Resource key to data
      • get

        public ICUResourceBundle get​(String key,
                                     String set,
                                     String contextKey,
                                     String subKey)
        Load data for calendar. Note, this object owns the resources... data is located in: "calendar/key/set/contextKey/subKey" for example, calendar/cyclicNameSets/years/format/abbreviated
        Parameters:
        key - Resource key to data
        set - Resource key to data
        contextKey - Resource key to data
        subKey - Resource key to data
      • getStringArray

        public String[] getStringArray​(String key)
      • getDateTimePatterns

        public String[] getDateTimePatterns()
      • getDateTimePattern

        public String getDateTimePattern()
        Returns the default date-time pattern such as {1}, {0}. {1} is always the date and {0} is always the time.
      • getDateTimePattern

        public String getDateTimePattern​(int style)
        Returns the date-time pattern by style where style is one of the style fields defined in DateFormat. If date-time patterns by style are not available, it returns what getDateTimePattern() would return.
        Parameters:
        style - the style e.g DateFormat.LONG.
        Returns:
        the pattern, e.g {1}, {0}.
      • getOverrides

        public String[] getOverrides()
      • getULocale

        public ULocale getULocale()