The constructor uses Calendar.DAY_OF_WEEK as if it represents the current day:
position = Calendar.DAY_OF_WEEK % 2;
However, Calendar.DAY_OF_WEEK is a field identifier constant, not the actual current day-of-week value. Therefore, this expression always produces the same starting position.
As a result, the iterator does not change its starting position based on the current day as intended.
Please retrieve the actual day-of-week value:
position = Calendar.getInstance().get(Calendar.DAY_OF_WEEK) % 2;
This will make the iterator's starting position depend on the actual current day.
The constructor uses
Calendar.DAY_OF_WEEKas if it represents the current day:position = Calendar.DAY_OF_WEEK % 2;
However,
Calendar.DAY_OF_WEEKis a field identifier constant, not the actual current day-of-week value. Therefore, this expression always produces the same starting position.As a result, the iterator does not change its starting position based on the current day as intended.
Please retrieve the actual day-of-week value:
position = Calendar.getInstance().get(Calendar.DAY_OF_WEEK) % 2;
This will make the iterator's starting position depend on the actual current day.