Ejemplo n.º 1
0
  private static String lookup(
      UnitPatternProvider p,
      Locale language,
      char unitID,
      TextWidth width,
      PluralCategory category) {

    switch (unitID) {
      case 'Y':
        return p.getYearPattern(language, width, category);
      case 'M':
        return p.getMonthPattern(language, width, category);
      case 'W':
        return p.getWeekPattern(language, width, category);
      case 'D':
        return p.getDayPattern(language, width, category);
      case 'H':
        return p.getHourPattern(language, width, category);
      case 'N':
        return p.getMinutePattern(language, width, category);
      case 'S':
        return p.getSecondPattern(language, width, category);
      case '3':
        return p.getMilliPattern(language, width, category);
      case '6':
        return p.getMicroPattern(language, width, category);
      case '9':
        return p.getNanoPattern(language, width, category);
      default:
        throw new UnsupportedOperationException("Unit-ID: " + unitID);
    }
  }