code: public void applyPattern(String pattern) {
          this.pattern = pattern;
          if (msgPattern == null) {
              msgPattern = new MessagePattern();
          }
          try {
              msgPattern.parsePluralStyle(pattern);
              offset = msgPattern.getPluralOffset(0);
          } catch(RuntimeException e) {
              resetPattern();
              throw e;
          }
      }
docs: Sets the pattern used by this plural format.
  The method parses the pattern and creates a map of format strings
  for the plural rules.
  Patterns and their interpretation are specified in the class description.
  
  @param pattern the pattern for this plural format.
  @throws IllegalArgumentException if the pattern is invalid.