Package org.sellcom.geotemporal.time
Class DaysOfWeek
- java.lang.Object
-
- org.sellcom.geotemporal.time.DaysOfWeek
-
public class DaysOfWeek extends Object
Operations with days-of-week.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAfter(DayOfWeek former, DayOfWeek latter)Checks whether the given former day-of-week follows the given latter day-of-week.static booleanisBefore(DayOfWeek former, DayOfWeek latter)Checks whether the given former day-of-week precedes the given latter day-of-week.static booleanisInRange(DayOfWeek dayOfWeek, DayOfWeek startDayOfWeek, DayOfWeek endDayOfWeek)Checks whether the given day-of-week is within the range of the given days-of-week.static DayOfWeeknext(DayOfWeek dayOfWeek)Returns the day-of-week following the given day-of-week.static DayOfWeekprevious(DayOfWeek dayOfWeek)Returns the day-of-week preceding the given day-of-week.
-
-
-
Method Detail
-
isAfter
public static boolean isAfter(DayOfWeek former, DayOfWeek latter)
Checks whether the given former day-of-week follows the given latter day-of-week.- Throws:
IllegalArgumentException- ifformerisnullIllegalArgumentException- iflatterisnull- Since:
- 1.0
-
isBefore
public static boolean isBefore(DayOfWeek former, DayOfWeek latter)
Checks whether the given former day-of-week precedes the given latter day-of-week.- Throws:
IllegalArgumentException- ifformerisnullIllegalArgumentException- iflatterisnull- Since:
- 1.0
-
isInRange
public static boolean isInRange(DayOfWeek dayOfWeek, DayOfWeek startDayOfWeek, DayOfWeek endDayOfWeek)
Checks whether the given day-of-week is within the range of the given days-of-week. Both the start day-of-week and the end day-of-week are inclusive and the range may wrap around the end of the week.- Throws:
IllegalArgumentException- ifdayOfWeekisnullIllegalArgumentException- ifstartDayOfWeekisnullIllegalArgumentException- ifendDayOfWeekisnull- Since:
- 1.0
-
next
public static DayOfWeek next(DayOfWeek dayOfWeek)
Returns the day-of-week following the given day-of-week.- Throws:
IllegalArgumentException- ifdayOfWeekisnull- Since:
- 1.0
-
previous
public static DayOfWeek previous(DayOfWeek dayOfWeek)
Returns the day-of-week preceding the given day-of-week.- Throws:
IllegalArgumentException- ifdayOfWeekisnull- Since:
- 1.0
-
-