Enum DayOfWeek
- All Implemented Interfaces:
Comparable<DayOfWeek>, TemporalAccessor
The seven days of the week, Monday first as ISO counts them.
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()1 for Monday to 7 for Sunday.minus(long days) The daydaysearlier, around the week.static DayOfWeekof(int dayOfWeek) The day numbereddayOfWeek, 1 for Monday to 7 for Sunday.plus(long days) The daydayslater, around the week.static DayOfWeekReturns the enum constant of this type with the specified name.static DayOfWeek[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
MONDAY
Monday, day 1. -
TUESDAY
Tuesday, day 2. -
WEDNESDAY
Wednesday, day 3. -
THURSDAY
Thursday, day 4. -
FRIDAY
Friday, day 5. -
SATURDAY
Saturday, day 6. -
SUNDAY
Sunday, day 7.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
The day numbereddayOfWeek, 1 for Monday to 7 for Sunday. -
getValue
public int getValue()1 for Monday to 7 for Sunday. -
plus
The daydayslater, around the week. -
minus
The daydaysearlier, around the week.
-