/** * Empty the buffer, then the iterator, without worrying about mode/state. * * @return */ public FetchSetDatum drain() { if (!_queue.isEmpty()) { return removeFromQueue(); } else if (safeHasNext()) { return new FetchSetDatum(new TupleEntry(_values.next())); } else { return null; } }
public boolean isEmpty() { return _queue.isEmpty() && !safeHasNext(); }