next method

void next()

Moves the iterator ahead to the next vertex and (possibly) linear component.

Implementation

void next() {
  if (!hasNext()) return;

  vertexIndex++;
  if (vertexIndex >= currentLine!.getNumPoints()) {
    componentIndex++;
    loadCurrentLine();
    vertexIndex = 0;
  }
}