Package cern.nxcals.api.domain
Class TimeWindow
- java.lang.Object
-
- cern.nxcals.api.domain.TimeWindow
-
- All Implemented Interfaces:
java.io.Serializable
public final class TimeWindow extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeWindow
after(long startNanos)
static TimeWindow
after(java.time.Instant start)
static TimeWindow
before(long endNanos)
static TimeWindow
before(java.time.Instant end)
static TimeWindow
between(long startNanos, long endNanos)
static TimeWindow
between(java.time.Instant startTime, java.time.Instant endTime)
boolean
bounds(TimeWindow window)
static java.util.Comparator<TimeWindow>
compareByEndTime()
static java.util.Comparator<TimeWindow>
compareByStartAndEndTime()
static java.util.Comparator<TimeWindow>
compareByStartTime()
boolean
contains(long time)
boolean
contains(java.time.Instant instant)
static TimeWindow
empty()
boolean
equals(java.lang.Object o)
TimeWindow
expand(TimeWindow window)
static TimeWindow
fromStrings(java.lang.String startTime, java.lang.String endTime)
java.time.Instant
getEndTime()
long
getEndTimeNanos()
java.time.Instant
getStartTime()
long
getStartTimeNanos()
int
hashCode()
static TimeWindow
infinite()
TimeWindow
intersect(TimeWindow window)
boolean
intersects(TimeWindow window)
boolean
isEmpty()
boolean
isFinite()
boolean
isInfinite()
boolean
isLeftInfinite()
boolean
isRightInfinite()
boolean
isWithinRangeRightExcluded(@lombok.NonNull long nanos)
TimeWindow
leftLimit(java.time.Instant limit)
static java.util.Set<TimeWindow>
mergeTimeWindows(java.util.Collection<TimeWindow> windows)
TimeWindow
rightLimit(java.time.Instant limit)
java.lang.String
toString()
-
-
-
Method Detail
-
compareByStartTime
public static java.util.Comparator<TimeWindow> compareByStartTime()
-
compareByEndTime
public static java.util.Comparator<TimeWindow> compareByEndTime()
-
compareByStartAndEndTime
public static java.util.Comparator<TimeWindow> compareByStartAndEndTime()
-
infinite
public static TimeWindow infinite()
-
empty
public static TimeWindow empty()
-
between
public static TimeWindow between(long startNanos, long endNanos)
-
after
public static TimeWindow after(long startNanos)
-
after
public static TimeWindow after(java.time.Instant start)
-
before
public static TimeWindow before(long endNanos)
-
before
public static TimeWindow before(java.time.Instant end)
-
between
public static TimeWindow between(java.time.Instant startTime, java.time.Instant endTime)
-
fromStrings
public static TimeWindow fromStrings(java.lang.String startTime, java.lang.String endTime)
-
getStartTimeNanos
public long getStartTimeNanos()
-
getEndTimeNanos
public long getEndTimeNanos()
-
expand
public TimeWindow expand(TimeWindow window)
-
intersect
public TimeWindow intersect(TimeWindow window)
-
contains
public boolean contains(java.time.Instant instant)
-
contains
public boolean contains(long time)
-
bounds
public boolean bounds(TimeWindow window)
-
intersects
public boolean intersects(TimeWindow window)
-
leftLimit
public TimeWindow leftLimit(java.time.Instant limit)
-
rightLimit
public TimeWindow rightLimit(java.time.Instant limit)
-
isWithinRangeRightExcluded
public boolean isWithinRangeRightExcluded(@NonNull @lombok.NonNull long nanos)
-
isEmpty
public boolean isEmpty()
-
isFinite
public boolean isFinite()
-
isInfinite
public boolean isInfinite()
-
isLeftInfinite
public boolean isLeftInfinite()
-
isRightInfinite
public boolean isRightInfinite()
-
mergeTimeWindows
public static java.util.Set<TimeWindow> mergeTimeWindows(java.util.Collection<TimeWindow> windows)
-
getStartTime
public java.time.Instant getStartTime()
-
getEndTime
public java.time.Instant getEndTime()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-