Interface DateTemporal
- All Known Implementing Classes:
Interval
public interface DateTemporal
Interface representing a temporal entity with a date interval.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancontainsDate(LocalDate date) Checks if the temporal entity contains the specified date.default booleancontainsInterval(DateTemporal interval) Checks if the temporal entity contains another temporal entity's interval.default booleancontainsMonth(YearMonth yearMonth) Checks if the temporal entity contains the specified month.default booleanChecks if the interval of this temporal entity ends after the specified date.default booleanendsAfterOrOn(LocalDate date) Checks if the interval of this temporal entity ends after or on the specified date.default booleanequalsInterval(DateTemporal interval) Checks if the interval of this temporal entity is equal to another temporal entity's interval.Gets the date interval of the temporal entity.default booleanisContainedIn(DateTemporal interval) Checks if the temporal entity is contained within another temporal entity's interval.default booleanisContainedIn(LocalDate from, LocalDate to) Checks if the temporal entity is contained within the specified date range.default booleanChecks if the temporal entity is within the specified date range.default booleanoverlapsInterval(DateTemporal interval) Checks if the interval of this temporal entity overlaps with another temporal entity's interval.default booleanoverlapsInterval(LocalDate start, LocalDate end) Checks if the interval of this temporal entity overlaps with the specified date range.default booleanoverlapsMonth(YearMonth yearMonth) Checks if the interval of this temporal entity overlaps with the specified month.default booleanoverlapsYear(LocalDate yearDate) Checks if the interval of this temporal entity overlaps with the year of the specified date.default booleanoverlapsYear(Year year) Checks if the interval of this temporal entity overlaps with the specified year.default booleanstartsAfter(LocalDate date) Checks if the interval of this temporal entity starts after the specified date.default booleanstartsBefore(LocalDate date) Checks if the interval of this temporal entity starts before the specified date.default booleanstartsBeforeOrOn(LocalDate date) Checks if the interval of this temporal entity starts before or on the specified date.
-
Method Details
-
getInterval
-
isInRange
-
isContainedIn
Checks if the temporal entity is contained within another temporal entity's interval.- Parameters:
interval- the other temporal entity.- Returns:
- true if this entity is contained within the other entity's interval, false otherwise.
-
isContainedIn
Checks if the temporal entity is contained within the specified date range.- Parameters:
from- the start date of the range.to- the end date of the range.- Returns:
- true if the temporal entity is contained within the range, false otherwise.
-
containsInterval
Checks if the temporal entity contains another temporal entity's interval.- Parameters:
interval- the other temporal entity.- Returns:
- true if this entity contains the other entity's interval, false otherwise.
-
containsDate
Checks if the temporal entity contains the specified date.- Parameters:
date- the date to check.- Returns:
- true if the temporal entity contains the date, false otherwise.
-
containsMonth
Checks if the temporal entity contains the specified month.- Parameters:
yearMonth- the month to check.- Returns:
- true if the temporal entity contains the month, false otherwise.
-
equalsInterval
Checks if the interval of this temporal entity is equal to another temporal entity's interval.- Parameters:
interval- the other temporal entity.- Returns:
- true if the intervals are equal, false otherwise.
-
overlapsInterval
Checks if the interval of this temporal entity overlaps with another temporal entity's interval.- Parameters:
interval- the other temporal entity.- Returns:
- true if the intervals overlap, false otherwise.
-
overlapsMonth
Checks if the interval of this temporal entity overlaps with the specified month.- Parameters:
yearMonth- the month to check.- Returns:
- true if the interval overlaps with the month, false otherwise.
-
overlapsYear
Checks if the interval of this temporal entity overlaps with the specified year.- Parameters:
year- the year to check.- Returns:
- true if the interval overlaps with the year, false otherwise.
-
overlapsYear
Checks if the interval of this temporal entity overlaps with the year of the specified date.- Parameters:
yearDate- the date whose year to check.- Returns:
- true if the interval overlaps with the year, false otherwise.
-
overlapsInterval
-
startsAfter
Checks if the interval of this temporal entity starts after the specified date.- Parameters:
date- the date to check.- Returns:
- true if the interval starts after the date, false otherwise.
-
endsAfter
Checks if the interval of this temporal entity ends after the specified date.- Parameters:
date- the date to check.- Returns:
- true if the interval ends after the date, false otherwise.
-
endsAfterOrOn
Checks if the interval of this temporal entity ends after or on the specified date.- Parameters:
date- the date to check.- Returns:
- true if the interval ends after or on the date, false otherwise.
-
startsBefore
Checks if the interval of this temporal entity starts before the specified date.- Parameters:
date- the date to check.- Returns:
- true if the interval starts before the date, false otherwise.
-
startsBeforeOrOn
Checks if the interval of this temporal entity starts before or on the specified date.- Parameters:
date- the date to check.- Returns:
- true if the interval starts before or on the date, false otherwise.
-