private void parseMonthDayTime(Scanner s,TZDBMonthDayTime mdt){
  mdt.month=parseMonth(s);
  if (s.hasNext()) {
    String dayRule=s.next();
    if (dayRule.startsWith("last")) {
      mdt.dayOfMonth=-1;
      mdt.dayOfWeek=parseDayOfWeek(dayRule.substring(4));
      mdt.adjustForwards=false;
    }
 else {
      int index=dayRule.indexOf(">=");
      if (index > 0) {
        mdt.dayOfWeek=parseDayOfWeek(dayRule.substring(0,index));
        dayRule=dayRule.substring(index + 2);
      }
 else {
        index=dayRule.indexOf("<=");
        if (index > 0) {
          mdt.dayOfWeek=parseDayOfWeek(dayRule.substring(0,index));
          mdt.adjustForwards=false;
          dayRule=dayRule.substring(index + 2);
        }
      }
      mdt.dayOfMonth=Integer.parseInt(dayRule);
    }
    if (s.hasNext()) {
      String timeStr=s.next();
      int secsOfDay=parseSecs(timeStr);
      if (secsOfDay == 86400) {
        mdt.endOfDay=true;
        secsOfDay=0;
      }
      LocalTime time=LocalTime.ofSecondOfDay(secsOfDay);
      mdt.time=time;
      mdt.timeDefinition=parseTimeDefinition(timeStr.charAt(timeStr.length() - 1));
    }
  }
}

private void parseMonthDayTime ( Scanner s , TZDBMonthDayTime mdt ) { mdt . month = parseMonth ( s ) ; if ( s . hasNext ( ) ) { String dayRule = s . next ( ) ; if ( dayRule . startsWith ( "last" ) ) { mdt . dayOfMonth = - 1 ; mdt . dayOfWeek = parseDayOfWeek ( dayRule . substring ( 4 ) ) ; mdt . adjustForwards = false ; } else { int index = dayRule . indexOf ( ">=" ) ; if ( index > 0 ) { mdt . dayOfWeek = parseDayOfWeek ( dayRule . substring ( 0 , index ) ) ; dayRule = dayRule . substring ( index + 2 ) ; } else { index = dayRule . indexOf ( "<=" ) ; if ( index > 0 ) { mdt . dayOfWeek = parseDayOfWeek ( dayRule . substring ( 0 , index ) ) ; mdt . adjustForwards = false ; dayRule = dayRule . substring ( index + 2 ) ; } } mdt . dayOfMonth = Integer . parseInt ( dayRule ) ; } if ( s . hasNext ( ) ) { String timeStr = s . next ( ) ; int secsOfDay = parseSecs ( timeStr ) ; if ( secsOfDay == 86400 ) { mdt . endOfDay = true ; secsOfDay = 0 ; } LocalTime time = LocalTime . ofSecondOfDay ( secsOfDay ) ; mdt . time = time ; mdt . timeDefinition = parseTimeDefinition ( timeStr . charAt ( timeStr . length ( ) - 1 ) ) ; } } }
parses a rule line .
