Interface EventIterator<X extends Event>

Type Parameters:
X - The event type.
All Known Implementing Classes:
ListEventIterator

public interface EventIterator<X extends Event>
Represents a feed of events.

Thread safety is important here. You should expect that getNext() will only be called from a single thread, BUT that hasMore() may be called from any thread. Thus, you should employ a strategy such as simply using a boolean field which you update after polling na event.

  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    default @Nullable Integer
     
  • Method Details

    • hasMore

      boolean hasMore()
    • getNext

      @Nullable X getNext()
      Returns:
      Next event, or null if no further events exist
    • totalEvents

      @Nullable default @Nullable Integer totalEvents()