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 of `BoundedWindow` that represents an interval from `start` (inclusive) to `end` (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
`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 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.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### 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 class `BoundedWindow`

#### 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.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### compareTo

    public int compareTo(IntervalWindow o)

Specified by:
  `compareTo` in interface `Comparable<IntervalWindow>`

#### getCoder

    public static Coder<IntervalWindow> getCoder()

Returns a `Coder` suitable for `IntervalWindow`.