Class WorkerIterator

java.lang.Object
de.calamanari.pk.iterator.WorkerIterator
All Implemented Interfaces:
java.util.Iterator<Worker>

public class WorkerIterator
extends java.lang.Object
implements java.util.Iterator<Worker>
Worker Iterator - the ITERATOR implementation in this example.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    WorkerIterator​(java.util.Set<Worker> workers)
    Creates new Iterator returning all workers and their subordinates (recursively) alphabetically ordered.
  • Method Summary

    Modifier and Type Method Description
    boolean hasNext()  
    Worker next()  
    void remove()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Constructor Details

    • WorkerIterator

      public WorkerIterator​(java.util.Set<Worker> workers)
      Creates new Iterator returning all workers and their subordinates (recursively) alphabetically ordered.
      Parameters:
      workers - (root elements)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<Worker>
    • next

      public Worker next()
      Specified by:
      next in interface java.util.Iterator<Worker>
    • remove

      public void remove()
      Specified by:
      remove in interface java.util.Iterator<Worker>