Package org.sellcom.geotemporal.time
Class Months
- java.lang.Object
-
- org.sellcom.geotemporal.time.Months
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAfter(Month former, Month latter)Checks whether the given former month follows the given latter month.static booleanisBefore(Month former, Month latter)Checks whether the given former month precedes the given latter month.static booleanisInRange(Month month, Month startMonth, Month endMonth)Checks whether the given month is within the range of the given months.static Monthnext(Month month)Returns the month following the given month.static Monthprevious(Month month)Returns the month preceding the given month.
-
-
-
Method Detail
-
isAfter
public static boolean isAfter(Month former, Month latter)
Checks whether the given former month follows the given latter month.- Throws:
IllegalArgumentException- ifformerisnullIllegalArgumentException- iflatterisnull- Since:
- 1.0
-
isBefore
public static boolean isBefore(Month former, Month latter)
Checks whether the given former month precedes the given latter month.- Throws:
IllegalArgumentException- ifformerisnullIllegalArgumentException- iflatterisnull- Since:
- 1.0
-
isInRange
public static boolean isInRange(Month month, Month startMonth, Month endMonth)
Checks whether the given month is within the range of the given months. Both the start month and the end month are inclusive and the range may wrap around the end of the year.- Throws:
IllegalArgumentException- ifmonthisnullIllegalArgumentException- ifstartMonthisnullIllegalArgumentException- ifendMonthisnull- Since:
- 1.0
-
next
public static Month next(Month month)
Returns the month following the given month.- Throws:
IllegalArgumentException- ifmonthisnull- Since:
- 1.0
-
previous
public static Month previous(Month month)
Returns the month preceding the given month.- Throws:
IllegalArgumentException- ifmonthisnull- Since:
- 1.0
-
-