Class DeficitTargetIterator

  • All Implemented Interfaces:
    java.util.Iterator<java.lang.Integer>

    public class DeficitTargetIterator
    extends java.lang.Object
    implements java.util.Iterator<java.lang.Integer>
    A class used for iterating over possible deficit targets. As iterating over the targets has to be done frequently in every iteration, possible targets are stored. Thus it is not necessary to iterate over the whole tree again during the second calculation of the reducing costs for a new source.
    Author:
    brockhoff
    • Constructor Summary

      Constructors 
      Constructor Description
      DeficitTargetIterator​(TreeIterator treeIt, java.util.List<java.lang.Integer> deficitTrees, int cTar, int firstTar)
      Instantiates a new TreeIterator from the root of a subtree
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int defTreeCount()  
      boolean hasNext()  
      java.lang.Integer next()  
      void nextIt()
      Resets the iterator for the next iteration.
      void remove()  
      void resetToStart()
      Resets the iterator for next pass on the same targets
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • DeficitTargetIterator

        public DeficitTargetIterator​(TreeIterator treeIt,
                                     java.util.List<java.lang.Integer> deficitTrees,
                                     int cTar,
                                     int firstTar)
        Instantiates a new TreeIterator from the root of a subtree
        Parameters:
        root - the root vertex of the subtree.
    • Method Detail

      • nextIt

        public void nextIt()
        Resets the iterator for the next iteration.
      • resetToStart

        public void resetToStart()
        Resets the iterator for next pass on the same targets
      • hasNext

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

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

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<java.lang.Integer>
      • defTreeCount

        public int defTreeCount()