public class RecurringDateModel extends Object implements XMLMarshallable
| Modifier and Type | Field and Description |
|---|---|
static int |
BIRTHDAY_DAY_OR_NEXT
Birthday day if exists in current month or first day of next month otherwise
|
static int |
DAILY
Frequency Daily.
|
static int |
LAST_DAY
Last day of month
|
static int |
MONTHLY
Frequency Monthly.
|
static int |
UNSET
Frequency not set.
|
static int |
WEEKLY
Frequency Weekly.
|
static int |
YEARLY
Frequency Yearly.
|
| Constructor and Description |
|---|
RecurringDateModel()
Builds an empty RecurringDateModel.
|
RecurringDateModel(int t,
int tPeriod,
int wd,
int pos,
int mon,
int hr,
int min)
Builds a RecurringDateModel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
int |
getHours()
Gets the hours.
|
int |
getMinutes()
Gets the minutes.
|
int |
getMonth()
Gets the month.
|
int |
getPosition()
Gets the position in the period defined by
setTypePeriod(). |
int |
getType()
Gets the type.
|
int |
getTypePeriod()
Gets the type period.
|
int |
getWeekDay()
Gets the week day.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
static RecurringDateModel |
parse(String s)
Parses a String to build a new RecurringDateModel.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setHours(int h)
Sets the hours.
|
void |
setMinutes(int m)
Sets the minutes.
|
void |
setMonth(int m)
Sets the month.
|
void |
setPosition(int p)
Sets the position defined by
setTypePeriod(). |
void |
setType(int t)
Sets the type.
|
void |
setTypePeriod(int period)
Sets the type period.
|
void |
setWeekDay(int wd)
Sets the week day.
|
String |
toString()
Converts to String "[type]/[weekDay]/[position]/[month]/[hours]/[minutes]/[typePeriod]".
|
public static final int DAILY
public static final int WEEKLY
public static final int MONTHLY
public static final int YEARLY
public static final int UNSET
public static final int LAST_DAY
public static final int BIRTHDAY_DAY_OR_NEXT
public RecurringDateModel()
public RecurringDateModel(int t,
int tPeriod,
int wd,
int pos,
int mon,
int hr,
int min)
t - the type.tPeriod - the period type.wd - the week day.pos - the position.mon - the month.hr - the hours.min - the minutes.public String toString()
public int getType()
public void setType(int t)
t - the type.public int getTypePeriod()
UNSETpublic void setTypePeriod(int period)
UNSETperiod - the type period.public int getWeekDay()
UNSETCalendar.SUNDAY,
Calendar.MONDAY,
Calendar.TUESDAY,
Calendar.WEDNESDAY,
Calendar.THURSDAY,
Calendar.FRIDAY,
Calendar.SATURDAYpublic void setWeekDay(int wd)
UNSETwd - the week day.Calendar.SUNDAY,
Calendar.MONDAY,
Calendar.TUESDAY,
Calendar.WEDNESDAY,
Calendar.THURSDAY,
Calendar.FRIDAY,
Calendar.SATURDAYpublic int getPosition()
setTypePeriod().public void setPosition(int p)
setTypePeriod().
If this field has not to be setted, the value is UNSET.p - the position.public int getMonth()
UNSETCalendar.JANUARY,
Calendar.FEBRUARY,
Calendar.MARCH,
Calendar.APRIL,
Calendar.MAY,
Calendar.JUNE,
Calendar.JULY,
Calendar.AUGUST,
Calendar.SEPTEMBER,
Calendar.OCTOBER,
Calendar.NOVEMBER,
Calendar.DECEMBERpublic void setMonth(int m)
UNSETm - the month.Calendar.JANUARY,
Calendar.FEBRUARY,
Calendar.MARCH,
Calendar.APRIL,
Calendar.MAY,
Calendar.JUNE,
Calendar.JULY,
Calendar.AUGUST,
Calendar.SEPTEMBER,
Calendar.OCTOBER,
Calendar.NOVEMBER,
Calendar.DECEMBERpublic int getHours()
public void setHours(int h)
UNSETh - the hours.public int getMinutes()
public void setMinutes(int m)
UNSETm - the minutes.public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic static RecurringDateModel parse(String s)
s - the String to parse.
The String has to respect the following format :
Type/Weekday/Position/Month/Hours/Minutes/TypePeriod
All members are int separated by a / char.
The TypePeriod if optional and value 1 is used if absent.