@Override public void complete() { if (!terminated) { terminated = true; // don't evict the terminal value evictionPolicy.evict(list); // so add it later list.addLast(enterTransform.call(nl.completed())); tail = list.tail; } } @Override
/** * Accept only non-stale nodes. * @param o the target observer * @param node the node to accept or reject * @param now the current time */ public void acceptTest(Observer<? super T> o, NodeList.Node<Object> node, long now) { Object v = node.value; if (!evictionPolicy.test(v, now)) { nl.accept(o, leaveTransform.call(v)); } } public Node<Object> head() {
@Override public void next(T value) { if (!terminated) { list.addLast(enterTransform.call(nl.next(value))); evictionPolicy.evict(list); tail = list.tail; } } @Override
@Override public void error(Throwable e) { if (!terminated) { terminated = true; // don't evict the terminal value evictionPolicy.evict(list); // so add it later list.addLast(enterTransform.call(nl.error(e))); tail = list.tail; } } public void accept(Observer<? super T> o, NodeList.Node<Object> node) {