@Override public boolean hasNext() { while (!stopped && windowEvent == null && inner.hasNext()) { Event<T> cur = inner.next(); EvictionPolicy.Action action = evictionPolicy.evict(cur); if (action == EXPIRE) { inner.remove(); } else if (action == STOP) { stopped = true; } else if (action == PROCESS) { windowEvent = cur.get(); } } return windowEvent != null; }
while (it.hasNext()) { Event<T> windowEvent = it.next(); Action action = evictionPolicy.evict(windowEvent); if (action == EXPIRE) { eventsToExpire.add(windowEvent.get());
while (it.hasNext()) { Event<T> windowEvent = it.next(); Action action = evictionPolicy.evict(windowEvent); if (action == EXPIRE) { eventsToExpire.add(windowEvent.get());