private void toNextDate ( Calendar date , int interval ) { long previousDate = date . getTimeInMillis ( ) ; if ( ! m_weekOfMonthIterator . hasNext ( ) ) { date . add ( Calendar . MONTH , interval ) ; m_weekOfMonthIterator = m_weeksOfMonth . iterator ( ) ; } toCorrectDateWithDay ( date , m_weekOfMonthIterator . next ( ) ) ; if ( previousDate == date . getTimeInMillis ( ) ) { // this can happen if the fourth and the last week are checked. toNextDate ( date ) ; } }
Calculates the next date starting from the provided date .