Class GroupIterator

  • All Implemented Interfaces:
    java.util.Iterator<Group>

    public class GroupIterator
    extends java.lang.Object
    implements java.util.Iterator<Group>
    An iterator over all groups of a structure.
    Since:
    1.4
    Version:
    %I% %G%
    Author:
    Andreas Prlic
    • Constructor Summary

      Constructors 
      Constructor Description
      GroupIterator​(Structure struct)
      Constructs a GroupIterator object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Creates and returns a copy of this object.
      Chain getCurrentChain()
      Get the current Chain.
      int getCurrentModel()
      Get the model number of the current model.
      boolean hasNext()
      is there a group after the current one in the structure?
      Group next()
      get next Group.
      void remove()
      does nothing .
      • Methods inherited from class java.lang.Object

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

        forEachRemaining
    • Constructor Detail

      • GroupIterator

        public GroupIterator​(Structure struct)
        Constructs a GroupIterator object.
        Parameters:
        struct - a Structure object
    • Method Detail

      • clone

        public java.lang.Object clone()
        Creates and returns a copy of this object.
        Overrides:
        clone in class java.lang.Object
      • hasNext

        public boolean hasNext()
        is there a group after the current one in the structure?
        Specified by:
        hasNext in interface java.util.Iterator<Group>
      • getCurrentModel

        public int getCurrentModel()
        Get the model number of the current model.
        Returns:
        the number of the model
      • getCurrentChain

        public Chain getCurrentChain()
        Get the current Chain. Returns null if we are at the end of the iteration.
        Returns:
        the Chain of the current position
      • next

        public Group next()
                   throws java.util.NoSuchElementException
        get next Group.
        Specified by:
        next in interface java.util.Iterator<Group>
        Returns:
        next Group
        Throws:
        java.util.NoSuchElementException - ...
      • remove

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