public class WorkingCalendar
extends com.appiancorp.core.expr.calendar.PortableWorkingCalendar
Modifier and Type | Field and Description |
---|---|
static java.lang.Long |
DEFAULT_CALENDAR_ID |
static java.lang.Integer |
SORT_BY_ID |
static java.lang.Integer |
SORT_BY_NAME |
Constructor and Description |
---|
WorkingCalendar() |
Modifier and Type | Method and Description |
---|---|
java.util.Calendar |
addDays(java.util.Calendar base,
int numberOfDays)
Add given number of working days to the given Calendar, yielding another Calendar that is also a working time.
|
java.util.Calendar |
addHours(java.util.Calendar startDateTime,
int numberOfHours)
Add given number of working hours to the given Calendar, yielding another Calendar that is also a working time.
|
java.util.Calendar |
addMinutes(java.util.Calendar startDateTime,
int numberOfMinutes)
Add given number of working minutes to the given Calendar, yielding another Calendar that is also a working time.
|
java.util.Calendar |
calendarFromTimestamp(java.sql.Timestamp timestamp,
java.util.TimeZone defaultTimeZone)
Create a Calendar from the given
java.sql.Timestamp , adjusted for the configured TimeZone of the WorkingCalendar,
or defaultTimeZone if none. |
CalendarElement[][] |
getDefaultDayOfWeek()
Get the default start and end times for the days of the week.
|
java.lang.Boolean |
getDisallowDelete()
Get whether or not deleting this calendar is enabled or disabled.
|
java.lang.Long |
getId()
Gets the id of this calendar
|
java.lang.String |
getName()
Gets the calendar's name
|
CalendarDateElement[] |
getSpecific()
Get the start and end times for specific days.
|
java.lang.Boolean |
getSystem()
Get whether or not this is a system calendar.
|
java.util.TimeZone |
getTimeZone() |
java.lang.String |
getTimeZoneId()
Get the id of the time zone for this calendar.
|
static boolean |
isNonWorking(CalendarElement[] day)
Tells if the given day is a non working day or not.
|
boolean |
isWorkingDay(java.util.Calendar calendar)
Is the day represented by this Calendar object a working day according to this working calendar?
|
boolean |
isWorkTime(java.util.Calendar calendar)
Does this Calendar represent a working time?
|
void |
setDefaultDayOfWeek(CalendarElement[][] defaultDayOfWeek)
Set the default start and end times for the days of the week.
|
void |
setDisallowDelete(java.lang.Boolean disallowDelete)
Set whether or not deleting this calendar is enabled or disabled.
|
void |
setId(java.lang.Long id)
Sets the id of this calendar
|
void |
setName(java.lang.String name)
Sets the calendars name
|
void |
setSpecific(CalendarDateElement[] specific)
Sets the start and end times for specific days.
|
void |
setSystem(java.lang.Boolean system)
Set whether or not this is a system calendar.
|
void |
setTimeZoneId(java.lang.String timeZoneId)
Set the name of the time zone for this calendar.
|
java.lang.String |
toString()
Simple toString method.
|
int |
workingDaysInRange(java.util.Calendar start,
java.util.Calendar end)
Count the number of working days in given range.
|
int |
workingHoursInRange(java.util.Calendar start,
java.util.Calendar end)
Count the number of working hours in given range.
|
int |
workingMinutesInRange(java.util.Calendar start,
java.util.Calendar end)
Count the number of working minutes in given range.
|
addDaysNoGmtAdjustment, addHoursNoGmtAdjustment, addMinutesNoGmtAdjustment, addMonthsNoGmtAdjustment, addSecondsNoGmtAdjustment, addYearsNoGmtAdjustment, adjustAddFinal, subtractDaysNoGmtAdjustment, subtractHoursNoGmtAdjustment, subtractMinutesNoGmtAdjustment, subtractMonthsNoGmtAdjustment, subtractSecondsNoGmtAdjustment, subtractYearsNoGmtAdjustment
public static final java.lang.Long DEFAULT_CALENDAR_ID
public static final java.lang.Integer SORT_BY_ID
public static final java.lang.Integer SORT_BY_NAME
public java.lang.Long getId()
public void setId(java.lang.Long id)
id
- public java.lang.String getName()
public void setName(java.lang.String name)
name
- public CalendarElement[][] getDefaultDayOfWeek()
CalendarElement
s define the default start and end times for the days
of the week. The first dimension of the array is the day of the week where 0 =
Sunday, 1 = Monday, ... , and 6 = Saturday. The second dimension is equal to the
number of start-end pairs that can be defined for a day (currently four).getDefaultDayOfWeek
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
CalendarElement
,
setDefaultDayOfWeek(CalendarElement[][])
public void setDefaultDayOfWeek(CalendarElement[][] defaultDayOfWeek)
defaultDayOfWeek
- The defaultDayOfWeek to set.getDefaultDayOfWeek()
public java.lang.Boolean getDisallowDelete()
true
means that deleting the calendar is not allowed.setDisallowDelete(Boolean)
public void setDisallowDelete(java.lang.Boolean disallowDelete)
disallowDelete
- Whether or not deleting is allowed for this calendar.getDisallowDelete()
public CalendarDateElement[] getSpecific()
CalendarDateElement
s defines start and end time pairs for specific
dates. The size of the array is unbounded, and order does not matter. Therefore
separate start and end pairs can be defined for the same date anywhere in the
array.getSpecific
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
CalendarDateElement
,
setSpecific(CalendarDateElement[])
public void setSpecific(CalendarDateElement[] specific)
specific
- The start and end times to set for specific days.getSpecific();
public java.lang.Boolean getSystem()
setSystem(Boolean)
public void setSystem(java.lang.Boolean system)
system
- Whether or not this is a system calendar.getSystem()
public static boolean isNonWorking(CalendarElement[] day)
day
- The day to find out if it's a non working daypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Calendar calendarFromTimestamp(java.sql.Timestamp timestamp, java.util.TimeZone defaultTimeZone)
java.sql.Timestamp
, adjusted for the configured TimeZone of the WorkingCalendar,
or defaultTimeZone if none.timestamp
- defaultTimeZone
- public void setTimeZoneId(java.lang.String timeZoneId)
setTimeZoneId
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
timeZoneId
- The time zone id to set for this calendar.getTimeZoneId()
public java.lang.String getTimeZoneId()
getTimeZoneId
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
setTimeZoneId(String)
public java.util.TimeZone getTimeZone()
getTimeZone
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
public int workingDaysInRange(java.util.Calendar start, java.util.Calendar end)
workingDaysInRange
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
start
- end
- public int workingHoursInRange(java.util.Calendar start, java.util.Calendar end)
workingHoursInRange
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
start
- end
- public int workingMinutesInRange(java.util.Calendar start, java.util.Calendar end)
workingMinutesInRange
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
start
- end
- public boolean isWorkTime(java.util.Calendar calendar)
isWorkTime
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
calendar
- public boolean isWorkingDay(java.util.Calendar calendar)
isWorkingDay
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
calendar
- public java.util.Calendar addDays(java.util.Calendar base, int numberOfDays)
addDays
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
base
- numberOfDays
- ; non-negativepublic java.util.Calendar addHours(java.util.Calendar startDateTime, int numberOfHours)
addHours
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
startDateTime
- numberOfHours
- ; non-negativepublic java.util.Calendar addMinutes(java.util.Calendar startDateTime, int numberOfMinutes)
addMinutes
in class com.appiancorp.core.expr.calendar.PortableWorkingCalendar
startDateTime
- numberOfMinutes
- ; non-negativeCopyright © 2003-2024 Appian Corporation. All Rights Reserved.