Package ch.poole.openinghoursparser
Class Holiday
java.lang.Object
ch.poole.openinghoursparser.Holiday
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
Container for objects from the opening_hours specification
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy of the objeczbooleanbooleanCheck if the holiday was originally after the week daysintgetType()booleanGet the the "use as weekday" valueinthashCode()voidsetAfterWeekDays(boolean afterWeekDays) Set the flag that the holidays should be shown after the weekdays This is necessary due to a specification changevoidsetOffset(int offset) voidsetType(Holiday.Type type) voidsetUseAsWeekDay(boolean useAsWeekDay) Set how this holiday should be usedCreate a string that identifies which class created it for debugging and testingtoString()
-
Constructor Details
-
Holiday
public Holiday()Default constructor -
Holiday
Construct a new Holiday with the same content- Parameters:
h- original Holiday
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getType
- Returns:
- the type
-
getOffset
public int getOffset()- Returns:
- the offset
-
setType
- Parameters:
type- the type to set
-
setOffset
public void setOffset(int offset) - Parameters:
offset- the offset to set
-
setUseAsWeekDay
public void setUseAsWeekDay(boolean useAsWeekDay) Set how this holiday should be used- Parameters:
useAsWeekDay- if true the holiday is a weekday equivalent
-
getUseAsWeekDay
public boolean getUseAsWeekDay()Get the the "use as weekday" value- Returns:
- true if this should be used as a weekday equivalent
-
setAfterWeekDays
public void setAfterWeekDays(boolean afterWeekDays) Set the flag that the holidays should be shown after the weekdays This is necessary due to a specification change- Parameters:
afterWeekDays- the value to set
-
getAfterWeekDays
public boolean getAfterWeekDays()Check if the holiday was originally after the week days- Returns:
- true if the holiday was after the week days
-
copy
Description copied from interface:CopyCreate a copy of the objecz- Returns:
- a copy of the object
-
toDebugString
Create a string that identifies which class created it for debugging and testing- Returns:
- the output of toString with the class name prepended
-