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)

        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

      • getDayType

        public int getDayType()

        Returns the type of a day.

        Returns:
        the type of a day Aspose.Tasks.DayType.
      • setDayType

        public void setDayType(int value)
        Sets the type of a day.
        Parameters:
        value - the type of a day Aspose.Tasks.DayType.
      • getDayWorking

        public boolean getDayWorking()

        Determines whether the specified date or day type is working. Read/write bool.

        Returns:
        true if the specified date or day type is working, false otherwise.
      • setDayWorking

        public void setDayWorking(boolean value)
        Determines whether the specified date or day type is working.
        Parameters:
        value - sets the day working if true.
      • getFromDate

        public Date getFromDate()

        Returns the beginning of an exception time.

        Returns:
        the beginning of an exception time (Date).
      • setFromDate

        public void setFromDate(Date value)

        Sets the beginning of an exception time.

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

        public Date getToDate()

        Returns the end of an exception time.

        Returns:
        the end of an exception time (Date).
      • setToDate

        public void setToDate(Date value)

        Sets the end of an exception time.

        Parameters:
        value - the end of an exception time (Date).
      • getWorkingTime

        public double getWorkingTime()

        Returns the working time for a week day.

        Returns:
        Working time for this WeekDay object.
      • getWorkingTimes

        public WorkingTimeCollection getWorkingTimes()

        Returns WorkingTimeCollection for this WeekDay instance. The collection of working times that define the time worked on the weekday. Read only WorkingTimeCollection instance.

        Returns:
        returns a collection of WorkingTime values for this object.
      • castToDayType

        public static int castToDayType(int dw)

        Casts .Net's DayOfWeek to DayType.

        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.
      • setDefaulWorkingTime

        public static void setDefaulWorkingTime(WeekDay day)

        Sets default time periods for the specified week day.

        Parameters:
        day - The week day to set default working day on.
      • deepClone

        public WeekDay deepClone()

        Implementation of IClonable interface, returns a deep copy of the week day.

        Returns:
        The deep copy.
      • 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 obj is a WeekDay that has the same FromDate, ToDate values and WorkingTimes as this instance; otherwise, <b>false</b>.
      • hashCode

        public int hashCode()
        Returns a hash code for this WeekDay.
        Overrides:
        hashCode in class Object
        Returns:
        Returns a hash code value for this object.