|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecttime.DayOfWeek
public final class DayOfWeek
Definition a day of the week.
Unlike month, this class is not an Enum, because DayOfWeek does not have a natural order. More precisely, even if everyone agrees on the order of weekdays, the first day of the week depends on the local usage.
This class provides also static method to have several appropriate Comparator or SortedSet where the first conventionnal day of the week has been set.
| Field Summary | |
|---|---|
static DayOfWeek |
FRIDAY
|
static DayOfWeek |
MONDAY
|
static DayOfWeek |
SATURDAY
|
static DayOfWeek |
SUNDAY
|
static DayOfWeek |
THURSDAY
|
static DayOfWeek |
TUESDAY
|
static DayOfWeek |
WEDNESDAY
|
| Method Summary | |
|---|---|
static DayOfWeek |
fromGcValue(int gc)
Returns the DayOfWeek object with the specified java.util.Calendar integer constant. |
int |
getGcValue()
Return the java.util.Calendar integer constant corresponding to this DayWeek object. |
static java.util.Comparator<DayOfWeek> |
specialComparator(DayOfWeek firstWeekDay)
Return a Comparator for sorting DayOfWeek. |
static java.util.SortedSet<DayOfWeek> |
specialSet(DayOfWeek firstWeekDay)
Return a immutable SortedSet with all seven DayOfWeek. |
java.lang.String |
toString()
Return a String describing the DayOfWeek |
static DayOfWeek |
valueOf(java.lang.String name)
Returns the DayOfWeek object with the specified name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DayOfWeek SUNDAY
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
| Method Detail |
|---|
public static java.util.Comparator<DayOfWeek> specialComparator(DayOfWeek firstWeekDay)
The conventionnal first week of the day must be provided, so that the Comparator can do his job.
firstWeekDay - conventionnal first day of week
public static java.util.SortedSet<DayOfWeek> specialSet(DayOfWeek firstWeekDay)
The conventionnal first week of the day must be provided.
firstWeekDay - conventionnal first day of week
public int getGcValue()
This method should be use only for compatibility with java.util.Calendar.
public java.lang.String toString()
toString in class java.lang.Objectpublic static DayOfWeek valueOf(java.lang.String name)
name - the name of the weekday to be returned
java.lang.IllegalArgumentException - if name is not a valid weekday name.public static DayOfWeek fromGcValue(int gc)
gc - a integer from java.util.Calendar weekday constants.
java.lang.IllegalArgumentException - if gc is not a valid integer constant.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||