Package ch.poole.openinghoursparser
Class YearRange
java.lang.Object
ch.poole.openinghoursparser.YearRange
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
Container for objects from the opening_hours specification
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intyears are defined as positive integers greater than 1900 (in the spec non-inclusive) however that might change one day -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy of the objeczbooleanintintintinthashCode()booleanCheck if this is open endedvoidsetEndYear(int end) Set the end of the year rangevoidsetInterval(int interval) voidsetOpenEnded(boolean openEnded) Set if this range is open endedvoidsetStartYear(int start) Set the start of the year rangeCreate a string that identifies which class created it for debugging and testingtoString()
-
Field Details
-
FIRST_VALID_YEAR
public static final int FIRST_VALID_YEAR- See Also:
-
UNDEFINED_YEAR
public static final int UNDEFINED_YEARyears are defined as positive integers greater than 1900 (in the spec non-inclusive) however that might change one day- See Also:
-
-
Constructor Details
-
YearRange
public YearRange()Default constructor -
YearRange
Construct a new YearRange with the same contents- Parameters:
yr- original YearRange
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getStartYear
public int getStartYear()- Returns:
- the startYear
-
getEndYear
public int getEndYear()- Returns:
- the endYear
-
getInterval
public int getInterval()- Returns:
- the interval
-
setStartYear
public void setStartYear(int start) Set the start of the year range- Parameters:
start- the year to set
-
setEndYear
public void setEndYear(int end) Set the end of the year range- Parameters:
end- the year to set
-
setInterval
public void setInterval(int interval) - Parameters:
interval- the interval to set
-
isOpenEnded
public boolean isOpenEnded()Check if this is open ended- Returns:
- true if open ended
-
setOpenEnded
public void setOpenEnded(boolean openEnded) Set if this range is open ended- Parameters:
openEnded- if true the range is open ended
-
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
-