com.aspose.tasks

Interfaces

Classes

Exceptions

com.aspose.tasks

Class WeekDay



  • public class WeekDay
    extends Object

    Represents a weekday which either defines regular days of a week or exception days in a calendar.

    • 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)

        IInitializes 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 to DayType(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.

        Overrides:
        equals in class Object
        Parameters:
        obj - The object to compare with this instance.
        Returns:
        <b>True</b> if the specified object is a WeekDay that has the same FromDate, ToDate values and WorkingTimes as this instance; otherwise, <b>false</b>.
      • getDayType

        public final int getDayType()

        Gets the type of a day. Read/write DayType.

        Returns:
        the type of a day.
      • setDayType

        public final void setDayType(int value)

        Sets the type of a day. Read/write DayType.

        Parameters:
        value - the type of a day.
      • getDayWorking

        public final boolean getDayWorking()

        Gets a value indicating whether the specified date or day type is working. Read/write boolean.

        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. Read/write boolean.

        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. Read/write Date.

        Returns:
        the beginning of an exception time.
      • setFromDate

        public final void setFromDate(Date value)

        Sets the beginning of an exception time. Read/write Date.

        Parameters:
        value - the beginning of an exception time.
      • getToDate

        public final Date getToDate()

        Gets the end of an exception time. Read/write Date.

        Returns:
        the end of an exception time.
      • setToDate

        public final void setToDate(Date value)

        Sets the end of an exception time. Read/write Date.

        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. Read only WorkingTimeCollection instance.

        Returns:
        WorkingTimeCollection for this WeekDay instance.
      • hashCode

        public int hashCode()

        Returns a hash code value for the instance of the WeekDay class.

        Overrides:
        hashCode in class Object
        Returns:
        returns a hash code value for this object.
      • 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.