Class TimeWindow


  • public class TimeWindow
    extends java.lang.Object
    Represents a time window for the events which are currently being read by a reader. The lower time bound is a timestamp which is less than or equal to the most recent value provided via the EventStreamWriter.noteTime(long) API for by any writer using that API at the current location in the stream. If the reader is near the beginning (or the truncation point) of the stream, there may be no timestamps to compare against and no lower bound can be established. Similarly the upper time bound is a timestamp which is greater than or equal to any that were provided by any writer via the EventStreamWriter.noteTime(long) API prior to the current location in the stream. If a reader is near the end (tail) of the stream there may be no writer timestamps to compare against and no upper bound can be established. upperTimeBound will always be greater than or equal to lowerTimeBound.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeWindow​(java.lang.Long lowerTimeBound, java.lang.Long upperTimeBound)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      java.lang.Long getLowerTimeBound()  
      java.lang.Long getUpperTimeBound()  
      int hashCode()  
      boolean isNearHeadOfStream()
      Returns true if the reader is currently near the head of the stream and therefore no lower time bound can be obtained.
      boolean isNearTailOfStream()
      Returns true if the reader is currently near the tail of the stream and therefore no upper time bound can be obtained.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TimeWindow

        @ConstructorProperties({"lowerTimeBound","upperTimeBound"})
        public TimeWindow​(java.lang.Long lowerTimeBound,
                          java.lang.Long upperTimeBound)
    • Method Detail

      • isNearTailOfStream

        public boolean isNearTailOfStream()
        Returns true if the reader is currently near the tail of the stream and therefore no upper time bound can be obtained.
        Returns:
        if a upper bound is unavailable.
      • isNearHeadOfStream

        public boolean isNearHeadOfStream()
        Returns true if the reader is currently near the head of the stream and therefore no lower time bound can be obtained.
        Returns:
        if a lower bound is unavailable.
      • getLowerTimeBound

        public java.lang.Long getLowerTimeBound()
      • getUpperTimeBound

        public java.lang.Long getUpperTimeBound()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object