WeekDay
Inheritance: java.lang.Object
public class WeekDay
Represents a weekday which either defines regular days of a week or exception days in a calendar.
Constructors
| Constructor | Description | 
|---|---|
| WeekDay(int dayType) | Initializes a new instance of the WeekDay class with the specified day type. | 
| WeekDay(int dayType, List<WorkingTime> workingTimes) | Initializes a new instance of the WeekDay class with the specified day type and list of working time periods. | 
| WeekDay(int dayType, WorkingTime[] workingTimes) | Initializes a new instance of the WeekDay class with the specified day type and working time periods. | 
| WeekDay() | Initializes a new instance of the WeekDay class. | 
Methods
| Method | Description | 
|---|---|
| castToDayType(int dw) | Casts .Net’s DayOfWeek to DayType(getDayType()/setDayType(int)). | 
| createDefaultWorkingDay(int dayType) | Creates default working day. | 
| deepClone() | Returns a deep copy of the week day. | 
| equals(Object obj) | Returns a value indicating whether this instance is equal to a specified object. | 
| getDayType() | Gets the type of a day. | 
| getDayWorking() | Gets a value indicating whether the specified date or day type is working. | 
| getFromDate() | Gets the beginning of an exception time. | 
| getToDate() | Gets the end of an exception time. | 
| getWorkingTime() | Returns the working time for a week day. | 
| getWorkingTimes() | Gets WorkingTimeCollection for this WeekDay instance. | 
| hashCode() | Returns a hash code value for the instance of the WeekDay class. | 
| setDayWorking(boolean value) | Sets a value indicating whether the specified date or day type is working. | 
| setDefaultWorkingTime(WeekDay day) | Sets default time periods for the specified week day. | 
| setFromDate(Date value) | Sets the beginning of an exception time. | 
| setToDate(Date value) | Sets the end of an exception time. | 
WeekDay(int dayType)
public WeekDay(int dayType)
Initializes a new instance of the WeekDay class with the specified day type.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| dayType | int | The specified day type. | 
WeekDay(int dayType, List<WorkingTime> workingTimes)
public WeekDay(int dayType, List<WorkingTime> workingTimes)
Initializes a new instance of the WeekDay class with the specified day type and list of working time periods.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| dayType | int | The specified day type. | 
| workingTimes | java.util.List<com.aspose.tasks.WorkingTime> | List of working time periods. | 
WeekDay(int dayType, WorkingTime[] workingTimes)
public WeekDay(int dayType, WorkingTime[] workingTimes)
Initializes a new instance of the WeekDay class with the specified day type and working time periods.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| dayType | int | The specified day type. | 
| workingTimes | WorkingTime[] | Array of working time periods. | 
WeekDay()
public WeekDay()
Initializes a new instance of the WeekDay class.
castToDayType(int dw)
public static int castToDayType(int dw)
Casts .Net’s DayOfWeek to DayType(getDayType()/setDayType(int)).
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| dw | int | The day of week to cast from. | 
Returns: int - A cast day type.
createDefaultWorkingDay(int dayType)
public static WeekDay createDefaultWorkingDay(int dayType)
Creates default working day.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| dayType | int | The day type to create default working day from. | 
Returns: WeekDay - A default working day with working times 8-12 and 13-17.
deepClone()
public final WeekDay deepClone()
Returns a deep copy of the week day.
Returns: WeekDay - Returns the deep copy of the week day.
equals(Object obj)
public boolean equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| obj | java.lang.Object | The object to compare with this instance. | 
Returns: boolean - True if the specified object is a WeekDay that has the same FromDate, ToDate values and WorkingTimes as this instance; otherwise, false.
getDayType()
public final int getDayType()
Gets the type of a day.
Returns: int - the type of a day.
getDayWorking()
public final boolean getDayWorking()
Gets a value indicating whether the specified date or day type is working.
Returns: boolean - a value indicating whether the specified date or day type is working.
getFromDate()
public final Date getFromDate()
Gets the beginning of an exception time.
Returns: java.util.Date - the beginning of an exception time.
getToDate()
public final Date getToDate()
Gets the end of an exception time.
Returns: java.util.Date - the end of an exception time.
getWorkingTime()
public final double getWorkingTime()
Returns the working time for a week day.
Returns: double - Working time.
getWorkingTimes()
public final WorkingTimeCollection getWorkingTimes()
Gets WorkingTimeCollection for this WeekDay instance. The collection of working times that define the time worked on the weekday.
Returns: WorkingTimeCollection - WorkingTimeCollection for this WeekDay instance.
hashCode()
public int hashCode()
Returns a hash code value for the instance of the WeekDay class.
Returns: int - returns a hash code value for this object.
setDayWorking(boolean value)
public final void setDayWorking(boolean value)
Sets a value indicating whether the specified date or day type is working.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | boolean | a value indicating whether the specified date or day type is working. | 
setDefaultWorkingTime(WeekDay day)
public static void setDefaultWorkingTime(WeekDay day)
Sets default time periods for the specified week day.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| day | WeekDay | The week day to set default working day on. | 
setFromDate(Date value)
public final void setFromDate(Date value)
Sets the beginning of an exception time.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | java.util.Date | the beginning of an exception time. | 
setToDate(Date value)
public final void setToDate(Date value)
Sets the end of an exception time.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | java.util.Date | the end of an exception time. |