com.highdeal.calendar.hci
Class HolidayModel.RelativeDay

java.lang.Object
  extended by com.highdeal.calendar.hci.HolidayModel.RelativeDay
All Implemented Interfaces:
HolidayModel.DayDefinition
Enclosing class:
HolidayModel

public static final class HolidayModel.RelativeDay
extends java.lang.Object
implements HolidayModel.DayDefinition

This Java class enables to define a relative day, that is to say a day given by a week day position in a month (e.g. second monday of January).


Constructor Summary
HolidayModel.RelativeDay(java.lang.String month, java.lang.String weekday, java.lang.String position)
          Builds a new RelativeDay.
 
Method Summary
 void checkValidity()
          Throws an InvalidHolidayException if: month is not one of month defined in MONTHS. weekday is not one of weekday defined in WEEKDAYS. position is not one of position defined in POSITIONS.
 java.lang.String getMonth()
          Gets the month.
 java.lang.String getPosition()
          Gets the position.
 int getType()
          Returns the type of the implementing class.
 java.lang.String getWeekday()
          Gets the weekday.
 void setMonth(java.lang.String month)
          Sets the month; Should be one of month names defined in MONTHS.
 void setPosition(java.lang.String position)
          Sets the position; Should be one of position names defined in POSITIONS.
 void setWeekday(java.lang.String weekday)
          Sets the weekday; Should be one of weekday names defined in WEEKDAYS.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HolidayModel.RelativeDay

public HolidayModel.RelativeDay(java.lang.String month,
                                java.lang.String weekday,
                                java.lang.String position)
Builds a new RelativeDay.

Parameters:
month - The month name, see MONTHS
weekday - The weekday name, see WEEKDAYS
position - The position of the weekday in the month, see POSITIONS
Method Detail

getMonth

public java.lang.String getMonth()
Gets the month.

Returns:
The month

setMonth

public void setMonth(java.lang.String month)
Sets the month; Should be one of month names defined in MONTHS.

Parameters:
month - The month

getPosition

public java.lang.String getPosition()
Gets the position.

Returns:
The position

setPosition

public void setPosition(java.lang.String position)
Sets the position; Should be one of position names defined in POSITIONS.

Parameters:
position - The position

getWeekday

public java.lang.String getWeekday()
Gets the weekday.

Returns:
Set the weekday

setWeekday

public void setWeekday(java.lang.String weekday)
Sets the weekday; Should be one of weekday names defined in WEEKDAYS.

Parameters:
weekday - The weekday

getType

public int getType()
Description copied from interface: HolidayModel.DayDefinition
Returns the type of the implementing class. Internal use only.

Specified by:
getType in interface HolidayModel.DayDefinition
Returns:
The type of the implementing class

checkValidity

public void checkValidity()
                   throws InvalidHolidayException
Throws an InvalidHolidayException if:

Specified by:
checkValidity in interface HolidayModel.DayDefinition
Throws:
InvalidHolidayException
See Also:
HolidayModel.FixedDay.checkValidity(), checkValidity(), HolidayModel.EasterRelativeDay.checkValidity(), HolidayModel.EnumeratedDay.checkValidity()

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