Package org.apache.kafka.streams.kstream
Class Window
- java.lang.Object
- 
- org.apache.kafka.streams.kstream.Window
 
- 
 public abstract class Window extends Object A single window instance, defined by its start and end timestamp.Windowis agnostic if start/end boundaries are inclusive or exclusive; this is defined by concrete window implementations.To specify how Windowboundaries are defined useWindows. For time semantics, seeTimestampExtractor.- See Also:
- Windows,- TimeWindow,- SessionWindow,- UnlimitedWindow,- TimestampExtractor
 
- 
- 
Constructor SummaryConstructors Constructor Description Window(long startMs, long endMs)Create a new window for the given start and end time.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longend()Return the end timestamp of this window.InstantendTime()Return the end time of this window.booleanequals(Object obj)inthashCode()abstract booleanoverlap(Window other)Check if the given window overlaps with this window.longstart()Return the start timestamp of this window.InstantstartTime()Return the start time of this window.StringtoString()
 
- 
- 
- 
Constructor Detail- 
Windowpublic Window(long startMs, long endMs) throws IllegalArgumentExceptionCreate a new window for the given start and end time.- Parameters:
- startMs- the start timestamp of the window
- endMs- the end timestamp of the window
- Throws:
- IllegalArgumentException- if- startMsis negative or if- endMsis smaller than- startMs
 
 
- 
 - 
Method Detail- 
startpublic long start() Return the start timestamp of this window.- Returns:
- The start timestamp of this window.
 
 - 
endpublic long end() Return the end timestamp of this window.- Returns:
- The end timestamp of this window.
 
 - 
startTimepublic Instant startTime() Return the start time of this window.- Returns:
- The start time of this window.
 
 - 
endTimepublic Instant endTime() Return the end time of this window.- Returns:
- The end time of this window.
 
 - 
overlappublic abstract boolean overlap(Window other) Check if the given window overlaps with this window. Should throw anIllegalArgumentExceptionif theotherwindow has a different type thanthiswindow.- Parameters:
- other- another window of the same type
- Returns:
- trueif- otheroverlaps with this window—- falseotherwise
 
 
- 
 
-