public class WeekDay extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
WeekDay.Day |
Modifier and Type | Field and Description |
---|---|
static WeekDay |
FR
Friday.
|
static WeekDay |
MO
Monday.
|
static WeekDay |
SA
Saturday.
|
static WeekDay |
SU
Sunday.
|
static WeekDay |
TH
Thursday.
|
static WeekDay |
TU
Tuesday.
|
static WeekDay |
WE
Wednesday.
|
Constructor and Description |
---|
WeekDay(String value) |
WeekDay(WeekDay weekDay,
int offset)
Constructs a new weekday instance based on the specified
instance and offset.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object arg0) |
static int |
getCalendarDay(WeekDay weekday)
Returns the corresponding
java.util.Calendar.DAY_OF_WEEK
constant for the specified WeekDay . |
WeekDay.Day |
getDay() |
static WeekDay |
getDay(int calDay)
Returns the corresponding day constant to the specified
java.util.Calendar.DAY_OF_WEEK property.
|
static DayOfWeek |
getDayOfWeek(WeekDay weekday) |
static WeekDay |
getMonthlyOffset(Calendar cal)
Returns a weekday/offset representation of the specified calendar.
|
static WeekDay |
getNegativeMonthlyOffset(Calendar cal)
Returns a weekday/negative offset representation of the specified calendar.
|
int |
getOffset() |
static WeekDay |
getWeekDay(Calendar cal)
Returns a weekday representation of the specified calendar.
|
static WeekDay |
getWeekDay(DayOfWeek dayOfWeek)
Returns a weekday representation of the specified day of week.
|
static WeekDay |
getWeekDay(WeekDay.Day day) |
int |
hashCode() |
String |
toString() |
public static final WeekDay SU
public static final WeekDay MO
public static final WeekDay TU
public static final WeekDay WE
public static final WeekDay TH
public static final WeekDay FR
public static final WeekDay SA
public WeekDay(String value)
value
- a string representation of a week daypublic WeekDay(WeekDay weekDay, int offset)
weekDay
- a week day template for the instanceoffset
- a month offset valuepublic final WeekDay.Day getDay()
public final int getOffset()
public static WeekDay getWeekDay(WeekDay.Day day)
public static WeekDay getWeekDay(Calendar cal)
cal
- a calendar (java.util)public static WeekDay getWeekDay(DayOfWeek dayOfWeek)
dayOfWeek
- day of the weekpublic static WeekDay getMonthlyOffset(Calendar cal)
cal
- a calendar (java.util)public static WeekDay getNegativeMonthlyOffset(Calendar cal)
cal
- a calendar (java.util)public static WeekDay getDay(int calDay)
calDay
- a property value of java.util.Calendar.DAY_OF_WEEKpublic static int getCalendarDay(WeekDay weekday)
java.util.Calendar.DAY_OF_WEEK
constant for the specified WeekDay
.weekday
- a week day instancejava.util.Calendar
day