public class TimeWindow extends Window
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeWindow.Serializer
The serializer used to write the TimeWindow type.
|
| Constructor and Description |
|---|
TimeWindow(long start,
long end) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Window o) |
TimeWindow |
cover(TimeWindow other)
Returns the minimal window covers both this window and the given window.
|
boolean |
equals(Object o) |
long |
getEnd()
Gets the end timestamp of this window.
|
long |
getStart()
Gets the starting timestamp of the window.
|
static long |
getWindowStartWithOffset(long timestamp,
long offset,
long windowSize)
Method to get the window start for a timestamp.
|
int |
hashCode() |
boolean |
intersects(TimeWindow other)
Returns
true if this window intersects the given window. |
long |
maxTimestamp()
Gets the largest timestamp that still belongs to this window.
|
static TimeWindow |
of(long start,
long end) |
String |
toString() |
public long getStart()
public long getEnd()
public long maxTimestamp()
This timestamp is identical to getEnd() - 1.
maxTimestamp in class WindowgetEnd()public boolean intersects(TimeWindow other)
true if this window intersects the given window.public TimeWindow cover(TimeWindow other)
public int compareTo(Window o)
public static long getWindowStartWithOffset(long timestamp,
long offset,
long windowSize)
timestamp - epoch millisecond to get the window start.offset - The offset which window start would be shifted by.windowSize - The size of the generated windows.public static TimeWindow of(long start, long end)
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.