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 theWeekDay
class.WeekDay(int dayType)
Initializes a new instance of theWeekDay
class with the specified day type.WeekDay(int dayType, List<WorkingTime> workingTimes)
Initializes a new instance of theWeekDay
class 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 int
castToDayType(int dw)
static WeekDay
createDefaultWorkingDay(int dayType)
Creates default working day.WeekDay
deepClone()
Returns a deep copy of the week day.boolean
equals(Object obj)
Returns a value indicating whether this instance is equal to a specified object.int
getDayType()
Gets the type of a day.boolean
getDayWorking()
Gets a value indicating whether the specified date or day type is working.Date
getFromDate()
Gets the beginning of an exception time.Date
getToDate()
Gets the end of an exception time.double
getWorkingTime()
Returns the working time for a week day.WorkingTimeCollection
getWorkingTimes()
Gets WorkingTimeCollection for this WeekDay instance.int
hashCode()
Returns a hash code value for the instance of theWeekDay
class.void
setDayWorking(boolean value)
Sets a value indicating whether the specified date or day type is working.static void
setDefaultWorkingTime(WeekDay day)
Sets default time periods for the specified week day.void
setFromDate(Date value)
Sets the beginning of an exception time.void
setToDate(Date value)
Sets the end of an exception time.
-
-
-
Constructor Detail
-
WeekDay
public WeekDay(int dayType)
Initializes a new instance of the
WeekDay
class 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
WeekDay
class 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
WeekDay
class.
-
-
Method Detail
-
castToDayType
public static int castToDayType(int dw)
Casts .Net's
DayOfWeek
toDayType
(getDayType()
/setDayType(int)
).- Parameters:
dw
- The day of week to cast from.- Returns:
- A cast 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
WeekDay
class.
-
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.
-
-