/** * <p>Gets the corresponding numerical ISO-value. </p> * * @return {@code monday=1, tuesday=2, wednesday=3, thursday=4, friday=5, saturday=6, sunday=7} * @see #valueOf(int) * @see Weekmodel#ISO */ /*[deutsch] * <p>Liefert den korrespondierenden kalendarischen Integer-Wert * entsprechend der ISO-8601-Norm. </p> * * @return {@code monday=1, tuesday=2, wednesday=3, thursday=4, friday=5, saturday=6, sunday=7} * @see #valueOf(int) * @see Weekmodel#ISO */ public int getValue() { return (this.ordinal() + 1); }
/** * <p>Rolls to the next day of week. </p> * * <p>The result is Monday if this method is applied on Sunday. </p> * * @return next weekday */ /*[deutsch] * <p>Ermittelt den nächsten Wochentag. </p> * * <p>Auf den Sonntag angewandt ist das Ergebnis der Montag. </p> * * @return next weekday */ public Weekday next() { int index = this.ordinal() + 1; if (index == 7) { index = 0; } return ENUMS[index]; }
/** * <p>Rolls this day of week by given amount of days. </p> * * @param days count of days (maybe negative) * @return result of rolling operation */ /*[deutsch] * <p>Rollt um die angegebene Anzahl von Tagen vor oder zurück. </p> * * @param days count of days (maybe negative) * @return result of rolling operation */ public Weekday roll(int days) { return Weekday.valueOf((this.ordinal() + (days % 7 + 7)) % 7 + 1); }
int shift = model.getFirstDayOfWeek().ordinal(); return ENUMS[(dayOfWeek - 1 + shift) % 7];