src/edu/kit/informatik/calendar_sample/DayOfWeek.java
/**
     * Returns the day with the specified index.
     * 
     * @param  index the index
     * @return the day
     * @throws IllegalArgumentException if {@code index} is not the index of a day of a week
     */
Returns the day with the specified index.

@param  index the index
@return the day
@throws IllegalArgumentException if  index is not the index of a day of a week
Returns the day with the specified index . @param index the index @return the day @throws IllegalArgumentException if index is not the index of a day of a week
public static DayOfWeek ofIndex(
            final int index) {
        assert DAYS.length == 7;
        if (index < 1 || index > DAYS.length)
            throw new IllegalArgumentException("Invalid index " + index + " (expected [1,7])");
        return DAYS[index - 1];
    }
public static DayOfWeek ofIndex ( final int index ) { assert DAYS . length == 7 ; if ( index < 1 || index > DAYS . length ) throw new IllegalArgumentException ( "Invalid index " + index + " (expected [1,7])" ) ; return DAYS [ index - 1 ] ; }
Returns the day with the specified index.
Returns the day with the specified index .
////