Package com.highdeal.pnr.hci
Class RecurringDateModel
java.lang.Object
com.highdeal.pnr.hci.RecurringDateModel
This class implements recurring rate.
A recurring Date contains the following information:
- the type of the recurring event
- The day of the week of the recurring event
- The position in the period of the recurring event
- The month of the recurring event
- The hour of the recurring event
- The minute of the recurring event
- The number of period of the recurring event
- 2 is for the period month
- -5 is for no day of the week is defined
- 12 is for the position in the period (the 12 of the month)
- -5 is for no specific month is defined
- 10 is for the hour of the event -> 10h05
- 5 is for the minute of the recurring event -> 10h05
- 3 is for each 3 months
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBirthday day if exists in current month or first day of next month otherwisestatic final intFrequency Daily.static final intLast day of monthstatic final intFrequency Monthly.static final intFrequency not set.static final intFrequency Weekly.static final intFrequency Yearly. -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty RecurringDateModel.RecurringDateModel(int t, int tPeriod, int wd, int pos, int mon, int hr, int min) Builds a RecurringDateModel. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetHours()Gets the hours.intGets the minutes.intgetMonth()Gets the month.intGets the position in the period defined bysetTypePeriod().intgetType()Gets the type.intGets the type period.intGets the week day.inthashCode()static RecurringDateModelParses a String to build a new RecurringDateModel.voidsetHours(int h) Sets the hours.voidsetMinutes(int m) Sets the minutes.voidsetMonth(int m) Sets the month.voidsetPosition(int p) Sets the position defined bysetTypePeriod().voidsetType(int t) Sets the type.voidsetTypePeriod(int period) Sets the type period.voidsetWeekDay(int wd) Sets the week day.toString()Converts to String "[type]/[weekDay]/[position]/[month]/[hours]/[minutes]/[typePeriod]".
-
Field Details
-
DAILY
public static final int DAILYFrequency Daily.- See Also:
-
WEEKLY
public static final int WEEKLYFrequency Weekly.- See Also:
-
MONTHLY
public static final int MONTHLYFrequency Monthly.- See Also:
-
YEARLY
public static final int YEARLYFrequency Yearly.- See Also:
-
UNSET
public static final int UNSETFrequency not set.- See Also:
-
LAST_DAY
public static final int LAST_DAYLast day of month- See Also:
-
BIRTHDAY_DAY_OR_NEXT
public static final int BIRTHDAY_DAY_OR_NEXTBirthday day if exists in current month or first day of next month otherwise- See Also:
-
-
Constructor Details
-
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 Details
-
toString
Converts to String "[type]/[weekDay]/[position]/[month]/[hours]/[minutes]/[typePeriod]". -
getType
public int getType()- Returns:
- the type.
-
setType
public void setType(int t) - 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 isUNSET- 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 isUNSET- Parameters:
period- the type period.
-
getWeekDay
public int getWeekDay()Gets the week day. If this field has not to be setted, the value isUNSET- Returns:
- the week day.
- See Also:
-
setWeekDay
public void setWeekDay(int wd) Sets the week day. If this field has not to be setted, the value isUNSET- Parameters:
wd- the week day.- See Also:
-
getPosition
public int getPosition()Gets the position in the period defined bysetTypePeriod().- Returns:
- the position.
-
setPosition
public void setPosition(int p) Sets the position defined bysetTypePeriod(). If this field has not to be setted, the value isUNSET.- Parameters:
p- the position.
-
getMonth
public int getMonth()Gets the month. If this field has not to be setted, the value isUNSET -
setMonth
public void setMonth(int m) Sets the month. If this field has not to be setted, the value isUNSET- Parameters:
m- the month.- See Also:
-
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 isUNSET- 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 isUNSET- Parameters:
m- the minutes.
-
parse
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.
-
hashCode
public int hashCode() -
equals
-