if (Thread.interrupted())
throw new OCommandExecutionException("The traverse execution has been interrupted");
if (lastTraversed != null) {
// RETURN LATEST AND RESET IT
final OIdentifiable result = lastTraversed;
lastTraversed = null;
return result;
}
if (limit > 0 && resultCount >= limit)
return null;
OIdentifiable result;
OTraverseAbstractProcess<?> toProcess;
// RESUME THE LAST PROCESS
while ((toProcess = nextProcess()) != null) {
result = toProcess.process();
if (result != null) {