public class IntervalWindow extends BoundedWindow implements java.lang.Comparable<IntervalWindow>
BoundedWindow
that represents an interval from start
(inclusive) to end
(exclusive).Modifier and Type | Class and Description |
---|---|
static class |
IntervalWindow.IntervalWindowCoder
Encodes an
IntervalWindow as a pair of its upper bound and duration. |
TIMESTAMP_MAX_VALUE, TIMESTAMP_MIN_VALUE
Constructor and Description |
---|
IntervalWindow(Instant start,
Instant end)
Creates a new IntervalWindow that represents the half-open time interval [start, end).
|
IntervalWindow(Instant start,
ReadableDuration size) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IntervalWindow o) |
boolean |
contains(IntervalWindow other)
Returns whether this window contains the given window.
|
Instant |
end()
Returns the end of this window, exclusive.
|
boolean |
equals(java.lang.Object o) |
static Coder<IntervalWindow> |
getCoder()
Returns a
Coder suitable for IntervalWindow . |
int |
hashCode() |
boolean |
intersects(IntervalWindow other)
Returns whether this window intersects the given window.
|
boolean |
isDisjoint(IntervalWindow other)
Returns whether this window is disjoint from the given window.
|
Instant |
maxTimestamp()
Returns the largest timestamp that can be included in this window.
|
IntervalWindow |
span(IntervalWindow other)
Returns the minimal window that includes both this window and the given window.
|
Instant |
start()
Returns the start of this window, inclusive.
|
java.lang.String |
toString() |
formatTimestamp, validateTimestampBounds
public IntervalWindow(Instant start, Instant end)
public IntervalWindow(Instant start, ReadableDuration size)
public Instant start()
public Instant end()
public Instant maxTimestamp()
maxTimestamp
in class BoundedWindow
public boolean contains(IntervalWindow other)
public boolean isDisjoint(IntervalWindow other)
public boolean intersects(IntervalWindow other)
public IntervalWindow span(IntervalWindow other)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(IntervalWindow o)
compareTo
in interface java.lang.Comparable<IntervalWindow>
public static Coder<IntervalWindow> getCoder()
Coder
suitable for IntervalWindow
.