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

ConstructorDescription
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

MethodDescription
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:

ParameterTypeDescription
dayTypeintThe 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:

ParameterTypeDescription
dayTypeintThe specified day type.
workingTimesjava.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:

ParameterTypeDescription
dayTypeintThe specified day type.
workingTimesWorkingTime[]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:

ParameterTypeDescription
dwintThe 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:

ParameterTypeDescription
dayTypeintThe 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:

ParameterTypeDescription
objjava.lang.ObjectThe 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:

ParameterTypeDescription
valuebooleana 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:

ParameterTypeDescription
dayWeekDayThe 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:

ParameterTypeDescription
valuejava.util.Datethe beginning of an exception time.

setToDate(Date value)

public final void setToDate(Date value)

Sets the end of an exception time.

Parameters:

ParameterTypeDescription
valuejava.util.Datethe end of an exception time.