public enum DayOfWeek extends Enum<DayOfWeek>
Enum Constant and Description |
---|
FRIDAY |
MONDAY |
SATURDAY |
SUNDAY |
THURSDAY |
TUESDAY |
WEDNESDAY |
Modifier and Type | Method and Description |
---|---|
static DayOfWeek |
fromNumber(int value)
Returns day of week by numeric value.
|
static DayOfWeek |
fromString(String name)
Returns day of week by full or short (3 letters) string name.
|
static DayOfWeek |
fromStringIgnoreCase(String name)
Returns day of week by full or short (3 letters) string name ignoring case.
|
DayOfWeek |
getNextDay()
Returns next day of week.
|
int |
getNumber()
Returns numeric value.
|
String |
getShortName()
Returns short (3 letters) name in the uppercase.
|
static DayOfWeek |
getToday()
Returns today day of week.
|
boolean |
isBetween(DayOfWeek firstDay,
DayOfWeek lastDay)
Returns whether the day of week is in the specified interval.
|
static DayOfWeek |
valueOf(String name)
Returns 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.
|
public static final DayOfWeek MONDAY
public static final DayOfWeek TUESDAY
public static final DayOfWeek WEDNESDAY
public static final DayOfWeek THURSDAY
public static final DayOfWeek FRIDAY
public static final DayOfWeek SATURDAY
public static final DayOfWeek SUNDAY
public static DayOfWeek[] values()
for (DayOfWeek c : DayOfWeek.values()) System.out.println(c);
public static DayOfWeek valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getNumber()
1
for Monday and 7
for Sunday.public String getShortName()
public static DayOfWeek getToday()
public DayOfWeek getNextDay()
public static DayOfWeek fromNumber(int value)
value
- numeric valueIllegalArgumentException
- if value is unexpectedpublic static DayOfWeek fromString(String name)
name
- full or short (3 letters) string name, i.g. MONDAY
or MON
IllegalArgumentException
- if string name is unexpectedpublic static DayOfWeek fromStringIgnoreCase(String name)
name
- full or short (3 letters) string name, i.g. Monday
or Mon
IllegalArgumentException
- if string name is unexpectedpublic boolean isBetween(DayOfWeek firstDay, DayOfWeek lastDay)
firstDay
- interval startlastDay
- interval endCopyright © 2005–2022 Onix Solutions. All rights reserved.