Enum Constant and Description |
---|
FRIDAY
|
MONDAY
|
SATURDAY
|
SUNDAY
|
THURSDAY
|
TUESDAY
|
WEDNESDAY
|
Modifier and Type | Method and Description |
---|---|
static DayOfWeek |
fromIsoIndex(int isoIndex)
Returns the non-null
DayOfWeek represented by
isoIndex , which can be 1 for Monday,
2 for Tuesday, 3 for Wednesday, 4
for Thursday, 5 for Friday, 6 for Saturday, or
7 for Sunday. |
static DayOfWeek |
fromString(java.lang.String string)
|
boolean |
isFriday()
|
boolean |
isMonday()
|
int |
isoIndex()
Returns the ISO weekday number for this
DayOfWeek :
1 for Monday, 2 for Tuesday, 3 for
Wednesday, 4 for Thursday, 5 for Friday,
6 for Saturday, and 7 for Sunday. |
boolean |
isSaturday()
|
boolean |
isSunday()
|
boolean |
isThursday()
|
boolean |
isTuesday()
|
boolean |
isWednesday()
|
DayOfWeek |
next()
Returns the non-null
DayOfWeek that comes immediately after
this DayOfWeek (e.g. as Monday comes after Sunday). |
DayOfWeek |
previous()
Returns the non-null
DayOfWeek that comes immediately before
this DayOfWeek (e.g. as Sunday comes before Monday). |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this enum
constant:
"Monday" , "Tuesday" ,
"Wednesday" , "Thursday" , "Friday" ,
"Saturday" , or "Sunday" . |
static DayOfWeek |
valueOf(java.lang.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(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
"Monday"
, "Tuesday"
,
"Wednesday"
, "Thursday"
, "Friday"
,
"Saturday"
, or "Sunday"
.toString
in class java.lang.Enum<DayOfWeek>
fromString(java.lang.String)
public int isoIndex()
DayOfWeek
:
1
for Monday, 2
for Tuesday, 3
for
Wednesday, 4
for Thursday, 5
for Friday,
6
for Saturday, and 7
for Sunday.fromIsoIndex(int)
public boolean isMonday()
public boolean isTuesday()
public boolean isWednesday()
public boolean isThursday()
public boolean isFriday()
public boolean isSaturday()
public boolean isSunday()
public DayOfWeek next()
DayOfWeek
that comes immediately after
this DayOfWeek
(e.g. as Monday comes after Sunday).public DayOfWeek previous()
DayOfWeek
that comes immediately before
this DayOfWeek
(e.g. as Sunday comes before Monday).public static DayOfWeek fromString(java.lang.String string) throws java.lang.IllegalArgumentException
java.lang.NullPointerException
- if string
is null
.java.lang.IllegalArgumentException
- if string
is not one of
"Monday"
, "Tuesday"
,
"Wednesday"
, "Thursday"
,
"Friday"
, "Saturday"
, or
"Sunday"
.toString()
public static DayOfWeek fromIsoIndex(int isoIndex)
DayOfWeek
represented by
isoIndex
, which can be 1
for Monday,
2
for Tuesday, 3
for Wednesday, 4
for Thursday, 5
for Friday, 6
for Saturday, or
7
for Sunday.java.lang.IndexOutOfBoundsException
- if isoIndex
is not
1
for Monday, 2
for Tuesday,
3
for Wednesday, 4
for Thursday,
5
for Friday, 6
for Saturday, or
7
for Sunday.isoIndex()
See www.degreedays.net/api/ for more about the Degree Days.net API.
You can sign up for a Degree Days.net API account and read the integration guide that is useful and applicable whether you are using Java or not.