public class WeekDaySchedule extends java.lang.Object implements Schedule, ScheduleLookAheadSupport
XML Snippet for WeekDaySchedule:
<Week impl= "com.ibm.commerce.marketing.promotion.schedule.WeekDaySchedule"> <WeekDay>Sunday</WeekDay> <WeekDay>Monday</WeekDay> <WeekDay>Tuesday</WeekDay> <WeekDay>Wednesday</WeekDay> <WeekDay>Thursday</WeekDay> <WeekDay>Friday</WeekDay> <WeekDay>Saturday</WeekDay> </Week>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
ALL_WEEK_LONG, END_OF_THE_DAY, END_OF_TIME, START_OF_THE_DAY, START_OF_TIME
DAY, HALF_AN_HOUR, HOUR, MINUTE, MONTH, QUARTER, SECOND, WEEK, YEAR
Constructor and Description |
---|
WeekDaySchedule()
Default constructor
|
WeekDaySchedule(int[] activeWeekDays)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateNextStateAndExpirationTime()
Calculates the next state shift time and the next state
|
int |
clockResolution()
Returns the constant for time resolution unit "Day"
|
boolean |
currentState()
Returns the current schedule state
|
java.util.Date |
currentStateValidUntil()
Returns the next status change time
|
void |
fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
java.util.Date |
getOverallEndDate()
Returns the overall end date, always return Schedule.END_OF_TIME
|
java.util.Date |
getOverallStartDate()
Returns the overall start date, always return Schedule.START_OF_TIME
|
boolean[] |
getWeekDays()
Returns the weekDays represented by an array of boolean
|
boolean |
isActive()
Checks to see if a schedule is active or not
|
boolean |
isActiveAsOf(java.util.Date theTime)
Checks to see if a schedule is active at a certain time
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public WeekDaySchedule()
public WeekDaySchedule(int[] activeWeekDays)
activeWeekDays
- days of the week, in which the schedule is activepublic boolean isActive()
Schedule
public boolean isActiveAsOf(java.util.Date theTime)
Schedule
isActiveAsOf
in interface Schedule
theTime
- the "certain time"com.ibm.commerce.discount.mixmatch.Schedule#isActiveAsOf(Date)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
node
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public int clockResolution()
clockResolution
in interface ScheduleLookAheadSupport
public boolean currentState()
currentState
in interface ScheduleLookAheadSupport
public java.util.Date currentStateValidUntil()
ScheduleLookAheadSupport
currentStateValidUntil
in interface ScheduleLookAheadSupport
ScheduleLookAheadSupport.currentStateValidUntil()
public void calculateNextStateAndExpirationTime()
calculateNextStateAndExpirationTime
in interface ScheduleLookAheadSupport
public java.util.Date getOverallStartDate()
getOverallStartDate
in interface Schedule
public java.util.Date getOverallEndDate()
getOverallEndDate
in interface Schedule
public boolean[] getWeekDays()