Class AllRefsIterator<T>

java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<T>
org.qubership.atp.dataset.model.utils.tree.AllRefsIterator<T>
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
RefsVisitor

public abstract class AllRefsIterator<T> extends com.google.common.collect.AbstractIterator<T>
Takes parents in form of iterator. Iterates over parents themselves plus over it's children, returned by getChildren(Object). Omits nulls and duplicates. May be used to traverse a tree.
  • Constructor Details

    • AllRefsIterator

      public AllRefsIterator(@Nonnull Iterator<? extends T> parents, boolean omitDuplicates)
    • AllRefsIterator

      protected AllRefsIterator(@Nonnull Iterator<? extends T> parents, Predicate<T> itemsFilter)
  • Method Details

    • computeNext

      protected T computeNext()
      Specified by:
      computeNext in class com.google.common.collect.AbstractIterator<T>
    • getChildren

      @Nullable protected abstract Iterator<? extends T> getChildren(@Nonnull T parent)
    • forwardToNewParent

      protected void forwardToNewParent(T parent)
    • backToPreviousParent

      protected void backToPreviousParent()