code: public static DayPeriodRules getInstance(ULocale locale) {
          String localeCode = locale.getName();
          if (localeCode.isEmpty()) { localeCode = "root"; }
  
          Integer ruleSetNum = null;
          while (ruleSetNum == null) {
              ruleSetNum = DATA.localesToRuleSetNumMap.get(localeCode);
              if (ruleSetNum == null) {
                  localeCode = ULocale.getFallback(localeCode);
                  if (localeCode.isEmpty()) {
                      // Saves a lookup in the map.
                      break;
                  }
              } else {
                  break;
              }
          }
  
          if (ruleSetNum == null || DATA.rules[ruleSetNum] == null) {
              // Data doesn't exist for the locale requested.
              return null;
          }
  
          return DATA.rules[ruleSetNum];
      }
docs: Get a DayPeriodRules object given a locale.
  If data hasn't been loaded, it will be loaded for all locales at once.
  @param locale locale for which the DayPeriodRules object is requested.
  @return a DayPeriodRules object for `locale`.