Class HashMapHierarchy.ItrDesc

  • All Implemented Interfaces:
    It<O>, Iter
    Enclosing class:
    HashMapHierarchy<O>

    private class HashMapHierarchy.ItrDesc
    extends java.lang.Object
    implements It<O>
    Iterator over all descendants.
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) It<O> childiter
      Iterator over children
      (package private) O extra
      Additional object to return as first result.
      (package private) It<O> subiter
      Iterator of current child
    • Constructor Summary

      Constructors 
      Constructor Description
      ItrDesc​(O start)
      Constructor for descendants-only.
      ItrDesc​(O start, O extra)
      Constructor with additional element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      It<O> advance()
      Moves the iterator forward to the next entry.
      O get()
      Access the current object.
      boolean valid()
      Returns true if the iterator currently points to a valid object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • childiter

        final It<O> childiter
        Iterator over children
      • subiter

        It<O> subiter
        Iterator of current child
      • extra

        O extra
        Additional object to return as first result.
    • Constructor Detail

      • ItrDesc

        ItrDesc​(O start)
        Constructor for descendants-only.
        Parameters:
        start - Starting element.
      • ItrDesc

        ItrDesc​(O start,
                O extra)
        Constructor with additional element.
        Parameters:
        start - Starting element.
        extra - Additional element (cannot be null).
    • Method Detail

      • valid

        public boolean valid()
        Description copied from interface: Iter
        Returns true if the iterator currently points to a valid object.
        Specified by:
        valid in interface Iter
        Returns:
        a boolean value, whether the position is valid.
      • advance

        public It<O> advance()
        Description copied from interface: Iter
        Moves the iterator forward to the next entry.
        Specified by:
        advance in interface It<O>
        Specified by:
        advance in interface Iter
        Returns:
        The iterator itself.
      • get

        public O get()
        Description copied from interface: It
        Access the current object.
        Specified by:
        get in interface It<O>
        Returns:
        Current object