com.google.cloud.dataflow.sdk.transforms.windowing

## Class PartitioningWindowFn<T,W extends BoundedWindow>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn<T,W>
  - - com.google.cloud.dataflow.sdk.transforms.windowing.NonMergingWindowFn<T,W>
    - - com.google.cloud.dataflow.sdk.transforms.windowing.PartitioningWindowFn<T,W>

Type Parameters:
  `T` - type of elements being windowed
  `W` - window type

All Implemented Interfaces:
  HasDisplayData, Serializable

Direct Known Subclasses:
  CalendarWindows.DaysWindows, CalendarWindows.MonthsWindows, CalendarWindows.YearsWindows, FixedWindows

    public abstract class PartitioningWindowFn<T,W extends BoundedWindow>
    extends NonMergingWindowFn<T,W>

A `WindowFn` that places each value into exactly one window based on its timestamp and never merges windows.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn

`WindowFn.AssignContext, WindowFn.MergeContext`

### Constructor Summary

Constructors
Constructor and Description
`PartitioningWindowFn()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`boolean` `assignsToSingleWindow()` Returns true if this `WindowFn` assigns each element to a single window.
`abstract W` `assignWindow(Instant timestamp)` Returns the single window to which elements with this timestamp belong.
`Collection<W>` `assignWindows(WindowFn.AssignContext c)` Given a timestamp and element, returns the set of windows into which it should be placed.
`Instant` `getOutputTime(Instant inputTimestamp, W window)`
`W` `getSideInputWindow(BoundedWindow window)` Returns the window of the side input corresponding to the given window of the main input.

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.NonMergingWindowFn

`isNonMerging, mergeWindows`

### Methods inherited from class com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn

`getOutputTimeFn, isCompatible, populateDisplayData, windowCoder`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PartitioningWindowFn

    public PartitioningWindowFn()

### Method Detail

#### assignWindow

    public abstract W assignWindow(Instant timestamp)

Returns the single window to which elements with this timestamp belong.

#### assignWindows

    public final Collection<W> assignWindows(WindowFn.AssignContext c)

Description copied from class: `WindowFn`
Given a timestamp and element, returns the set of windows into which it should be placed.

Specified by:
  `assignWindows` in class `WindowFn<T,W extends BoundedWindow>`

#### getSideInputWindow

    public W getSideInputWindow(BoundedWindow window)

Description copied from class: `WindowFn`
Returns the window of the side input corresponding to the given window of the main input.

Authors of custom `WindowFn`s should override this.

Specified by:
  `getSideInputWindow` in class `WindowFn<T,W extends BoundedWindow>`

#### assignsToSingleWindow

    public boolean assignsToSingleWindow()

Description copied from class: `WindowFn`
Returns true if this `WindowFn` assigns each element to a single window.

Overrides:
  `assignsToSingleWindow` in class `WindowFn<T,W extends BoundedWindow>`

#### getOutputTime

    public Instant getOutputTime(Instant inputTimestamp,
                                 W window)

Overrides:
  `getOutputTime` in class `WindowFn<T,W extends BoundedWindow>`