public class IntervalWindow extends BoundedWindow implements java.lang.Comparable<IntervalWindow>
BoundedWindow that represents an interval from
start (inclusive) to end (exclusive).TIMESTAMP_MAX_VALUE, TIMESTAMP_MIN_VALUE| Constructor and Description |
|---|
IntervalWindow(Instant start,
Duration size) |
IntervalWindow(Instant start,
Instant end)
Creates a new IntervalWindow that represents the half-open time
interval [start, end).
|
| 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 encoding IntervalWindows.
|
static Coder<IntervalWindow> |
getFixedSizeCoder(Duration size)
Returns a Coder for encoding interval windows of fixed size (which
is more efficient than
getCoder() as it only needs to encode
one endpoint). |
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() |
public IntervalWindow(Instant start, Instant end)
public Instant start()
public Instant end()
public Instant maxTimestamp()
maxTimestamp in class BoundedWindowpublic 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(IntervalWindow o)
compareTo in interface java.lang.Comparable<IntervalWindow>public static Coder<IntervalWindow> getCoder()
public static Coder<IntervalWindow> getFixedSizeCoder(Duration size)
getCoder() as it only needs to encode
one endpoint).