@Override
 public int parsePart(String value, EventRecurrence er) {
   int[] bymonth = parseNumberList(value, 1, 12, false);
   er.bymonth = bymonth;
   er.bymonthCount = bymonth.length;
   return PARSED_BYMONTH;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] bysetpos = parseNumberList(value, Integer.MIN_VALUE, Integer.MAX_VALUE, true);
   er.bysetpos = bysetpos;
   er.bysetposCount = bysetpos.length;
   return PARSED_BYSETPOS;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] byyearday = parseNumberList(value, -366, 366, false);
   er.byyearday = byyearday;
   er.byyeardayCount = byyearday.length;
   return PARSED_BYYEARDAY;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] byweekno = parseNumberList(value, -53, 53, false);
   er.byweekno = byweekno;
   er.byweeknoCount = byweekno.length;
   return PARSED_BYWEEKNO;
 }
    @Override
    public int parsePart(String value, EventRecurrence er) {
      int[] byday;
      int[] bydayNum;
      int bydayCount;

      if (value.indexOf(",") < 0) {
        /* only one entry, skip split() overhead */
        bydayCount = 1;
        byday = new int[1];
        bydayNum = new int[1];
        parseWday(value, byday, bydayNum, 0);
      } else {
        String[] wdays = value.split(",");
        int len = wdays.length;
        bydayCount = len;
        byday = new int[len];
        bydayNum = new int[len];
        for (int i = 0; i < len; i++) {
          parseWday(wdays[i], byday, bydayNum, i);
        }
      }
      er.byday = byday;
      er.bydayNum = bydayNum;
      er.bydayCount = bydayCount;
      return PARSED_BYDAY;
    }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] bymonthday = parseNumberList(value, -31, 31, false);
   er.bymonthday = bymonthday;
   er.bymonthdayCount = bymonthday.length;
   return PARSED_BYMONTHDAY;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] byminute = parseNumberList(value, 0, 59, true);
   er.byminute = byminute;
   er.byminuteCount = byminute.length;
   return PARSED_BYMINUTE;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] byhour = parseNumberList(value, 0, 23, true);
   er.byhour = byhour;
   er.byhourCount = byhour.length;
   return PARSED_BYHOUR;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   int[] bysecond = parseNumberList(value, 0, 59, true);
   er.bysecond = bysecond;
   er.bysecondCount = bysecond.length;
   return PARSED_BYSECOND;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   er.interval = parseIntRange(value, Integer.MIN_VALUE, Integer.MAX_VALUE, true);
   if (er.interval < 1) {
     Log.d(TAG, "Invalid Interval. Forcing INTERVAL to 1 from " + value);
     er.interval = 1;
   }
   return PARSED_INTERVAL;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   er.count = parseIntRange(value, Integer.MIN_VALUE, Integer.MAX_VALUE, true);
   if (er.count < 0) {
     Log.d(TAG, "Invalid Count. Forcing COUNT to 1 from " + value);
     er.count = 1; // invalid count. assume one time recurrence.
   }
   return PARSED_COUNT;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   Integer wkst = sParseWeekdayMap.get(value);
   if (wkst == null) {
     throw new InvalidFormatException("Invalid WKST value: " + value);
   }
   er.wkst = wkst;
   return PARSED_WKST;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   Integer freq = sParseFreqMap.get(value);
   if (freq == null) {
     throw new InvalidFormatException("Invalid FREQ value: " + value);
   }
   er.freq = freq;
   return PARSED_FREQ;
 }
 @Override
 public int parsePart(String value, EventRecurrence er) {
   if (VALIDATE_UNTIL) {
     try {
       // Parse the time to validate it.  The result isn't retained.
       Time until = new Time();
       until.parse(value);
     } catch (TimeFormatException tfe) {
       throw new InvalidFormatException("Invalid UNTIL value: " + value);
     }
   }
   er.until = value;
   return PARSED_UNTIL;
 }