/** * Returns the next vertex in the ordering. * * @return the next vertex in the ordering. */ @Override public V next() { if (!hasNext()) { throw new NoSuchElementException(); } V result = current; current = null; if (nListeners != 0) { fireVertexFinished(createVertexTraversalEvent(result)); } return result; }