Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.transforms.windowing
Class IntervalWindow
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.transforms.windowing.BoundedWindow
-
- com.google.cloud.dataflow.sdk.transforms.windowing.IntervalWindow
-
- All Implemented Interfaces:
- Comparable<IntervalWindow>
public class IntervalWindow extends BoundedWindow implements Comparable<IntervalWindow>
An implementation ofBoundedWindow
that represents an interval fromstart
(inclusive) toend
(exclusive).
-
-
Field Summary
-
Fields inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.BoundedWindow
TIMESTAMP_MAX_VALUE, TIMESTAMP_MIN_VALUE
-
-
Constructor Summary
Constructors 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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(Object o)
static Coder<IntervalWindow>
getCoder()
Returns aCoder
suitable forIntervalWindow
.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.String
toString()
-
-
-
Constructor Detail
-
IntervalWindow
public IntervalWindow(Instant start, Instant end)
Creates a new IntervalWindow that represents the half-open time interval [start, end).
-
IntervalWindow
public IntervalWindow(Instant start, ReadableDuration size)
-
-
Method Detail
-
start
public Instant start()
Returns the start of this window, inclusive.
-
end
public Instant end()
Returns the end of this window, exclusive.
-
maxTimestamp
public Instant maxTimestamp()
Returns the largest timestamp that can be included in this window.- Specified by:
maxTimestamp
in classBoundedWindow
-
contains
public boolean contains(IntervalWindow other)
Returns whether this window contains the given window.
-
isDisjoint
public boolean isDisjoint(IntervalWindow other)
Returns whether this window is disjoint from the given window.
-
intersects
public boolean intersects(IntervalWindow other)
Returns whether this window intersects the given window.
-
span
public IntervalWindow span(IntervalWindow other)
Returns the minimal window that includes both this window and the given window.
-
compareTo
public int compareTo(IntervalWindow o)
- Specified by:
compareTo
in interfaceComparable<IntervalWindow>
-
getCoder
public static Coder<IntervalWindow> getCoder()
Returns aCoder
suitable forIntervalWindow
.
-
-