com.highdeal.pnr.hci
Class RecurringDateModel

java.lang.Object
  extended by com.highdeal.pnr.hci.RecurringDateModel
All Implemented Interfaces:
XMLMarshallable

public class RecurringDateModel
extends java.lang.Object
implements XMLMarshallable

This class implements recurring rate. A recurring Date contains the following information:

An example of a recurring date is: 2/-5/12/-5/10/5/3 with


Field Summary
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 Summary
RecurringDateModel()
          Builds an empty RecurringDateModel.
RecurringDateModel(int t, int tPeriod, int wd, int pos, int mon, int hr, int min)
          Builds a RecurringDateModel.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.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(java.lang.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.
 java.lang.String toString()
          Converts to String "[type]/[weekDay]/[position]/[month]/[hours]/[minutes]/[typePeriod]".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DAILY

public static final int DAILY
Frequency Daily.

See Also:
Constant Field Values

WEEKLY

public static final int WEEKLY
Frequency Weekly.

See Also:
Constant Field Values

MONTHLY

public static final int MONTHLY
Frequency Monthly.

See Also:
Constant Field Values

YEARLY

public static final int YEARLY
Frequency Yearly.

See Also:
Constant Field Values

UNSET

public static final int UNSET
Frequency not set.

See Also:
Constant Field Values

LAST_DAY

public static final int LAST_DAY
Last day of month

See Also:
Constant Field Values

BIRTHDAY_DAY_OR_NEXT

public static final int BIRTHDAY_DAY_OR_NEXT
Birthday day if exists in current month or first day of next month otherwise

See Also:
Constant Field Values
Constructor Detail

RecurringDateModel

public RecurringDateModel()
Builds an empty RecurringDateModel.


RecurringDateModel

public RecurringDateModel(int t,
                          int tPeriod,
                          int wd,
                          int pos,
                          int mon,
                          int hr,
                          int min)
Builds a RecurringDateModel.

Parameters:
t - the type.
tPeriod - the period type.
wd - the week day.
pos - the position.
mon - the month.
hr - the hours.
min - the minutes.
Method Detail

toString

public java.lang.String toString()
Converts to String "[type]/[weekDay]/[position]/[month]/[hours]/[minutes]/[typePeriod]".

Overrides:
toString in class java.lang.Object
Returns:
a String, representing the recurring date.

getType

public int getType()
Gets the type. Returned values are :

Returns:
the type.

setType

public void setType(int t)
Sets the type. Allowed values are :

Parameters:
t - the type.

getTypePeriod

public int getTypePeriod()
Gets the type period. Number of periods the recurring event occurs. If this field has not to be setted, the value is UNSET

Returns:
the type period.

setTypePeriod

public void setTypePeriod(int period)
Sets the type period. Number of periods the recurring event occurs. If this field has not to be setted, the value is UNSET

Parameters:
period - the type period.

getWeekDay

public int getWeekDay()
Gets the week day. If this field has not to be setted, the value is UNSET

Returns:
the week day.
See Also:
Calendar.SUNDAY, Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY

setWeekDay

public void setWeekDay(int wd)
Sets the week day. If this field has not to be setted, the value is UNSET

Parameters:
wd - the week day.
See Also:
Calendar.SUNDAY, Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY

getPosition

public int getPosition()
Gets the position in the period defined by setTypePeriod().

Returns:
the position.

setPosition

public void setPosition(int p)
Sets the position defined by setTypePeriod(). If this field has not to be setted, the value is UNSET.

Parameters:
p - the position.

getMonth

public int getMonth()
Gets the month. If this field has not to be setted, the value is UNSET

Returns:
the month.
See Also:
Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL, Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST, Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER

setMonth

public void setMonth(int m)
Sets the month. If this field has not to be setted, the value is UNSET

Parameters:
m - the month.
See Also:
Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL, Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST, Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER

getHours

public int getHours()
Gets the hours.

Returns:
the hours.

setHours

public void setHours(int h)
Sets the hours. If this field has not to be setted, the value is UNSET

Parameters:
h - the hours.

getMinutes

public int getMinutes()
Gets the minutes.

Returns:
the minutes.

setMinutes

public void setMinutes(int m)
Sets the minutes. If this field has not to be setted, the value is UNSET

Parameters:
m - the minutes.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

parse

public static RecurringDateModel parse(java.lang.String s)
Parses a String to build a new RecurringDateModel.

Parameters:
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.
Returns:
the built recurring date.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)