Class WeekDay
- java.lang.Object
-
- com.aspose.tasks.WeekDay
-
public class WeekDay extends Object
Represents a weekday which either defines regular days of a week or exception days in a calendar.
-
-
Constructor Summary
Constructors Constructor Description WeekDay()Initializes a new instance of theWeekDayclass.WeekDay(int dayType)Initializes a new instance of theWeekDayclass with the specified day type.WeekDay(int dayType, List<WorkingTime> workingTimes)Initializes a new instance of theWeekDayclass with the specified day type and list of working time periods.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcastToDayType(int dw)static WeekDaycreateDefaultWorkingDay(int dayType)Creates default working day.WeekDaydeepClone()Returns a deep copy of the week day.booleanequals(Object obj)Returns a value indicating whether this instance is equal to a specified object.intgetDayType()Gets the type of a day.booleangetDayWorking()Gets a value indicating whether the specified date or day type is working.DategetFromDate()Gets the beginning of an exception time.DategetToDate()Gets the end of an exception time.doublegetWorkingTime()Returns the working time for a week day.WorkingTimeCollectiongetWorkingTimes()Gets WorkingTimeCollection for this WeekDay instance.inthashCode()Returns a hash code value for the instance of theWeekDayclass.voidsetDayWorking(boolean value)Sets a value indicating whether the specified date or day type is working.static voidsetDefaultWorkingTime(WeekDay day)Sets default time periods for the specified week day.voidsetFromDate(Date value)Sets the beginning of an exception time.voidsetToDate(Date value)Sets the end of an exception time.
-
-
-
Constructor Detail
-
WeekDay
public WeekDay(int dayType)
Initializes a new instance of the
WeekDayclass with the specified day type.- Parameters:
dayType- The specified day type.
-
WeekDay
public WeekDay(int dayType, List<WorkingTime> workingTimes)Initializes a new instance of the
WeekDayclass with the specified day type and list of working time periods.- Parameters:
dayType- The specified day type.workingTimes- List of working time periods.
-
WeekDay
public WeekDay()
Initializes a new instance of the
WeekDayclass.
-
-
Method Detail
-
castToDayType
public static int castToDayType(int dw)
Casts .Net's
DayOfWeektoDayType(getDayType()/setDayType(int)).- Parameters:
dw- The day of week to cast from.- Returns:
- A casted day type.
-
createDefaultWorkingDay
public static WeekDay createDefaultWorkingDay(int dayType)
Creates default working day.
- Parameters:
dayType- The day type to create default working day from.- Returns:
- A created default working day.
-
deepClone
public final WeekDay deepClone()
Returns a deep copy of the week day.
- Returns:
- Returns the deep copy of the week day.
-
equals
public boolean equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.
-
getDayType
public final int getDayType()
Gets the type of a day.
- Returns:
- the type of a day.
-
getDayWorking
public final boolean getDayWorking()
Gets a value indicating whether the specified date or day type is working.
- Returns:
- a value indicating whether the specified date or day type is working.
-
setDayWorking
public final void setDayWorking(boolean value)
Sets a value indicating whether the specified date or day type is working.
- Parameters:
value- 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:
- the beginning of an exception time.
-
setFromDate
public final void setFromDate(Date value)
Sets the beginning of an exception time.
- Parameters:
value- the beginning of an exception time.
-
getToDate
public final Date getToDate()
Gets the end of an exception time.
- Returns:
- the end of an exception time.
-
setToDate
public final void setToDate(Date value)
Sets the end of an exception time.
- Parameters:
value- the end of an exception time.
-
getWorkingTime
public final double getWorkingTime()
Returns the working time for a week day.
- Returns:
- 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 for this WeekDay instance.
-
hashCode
public int hashCode()
Returns a hash code value for the instance of the
WeekDayclass.
-
setDefaultWorkingTime
public static void setDefaultWorkingTime(WeekDay day)
Sets default time periods for the specified week day.
- Parameters:
day- The week day to set default working day on.
-
-