Module gen.tree

Class MaxIndexFinderTreeNodeVisitor<V,​K,​T extends IBaseTreeNode<V,​K,​T>>

  • Type Parameters:
    T - the generic type of the value
    All Implemented Interfaces:
    io.github.astrapi69.design.pattern.visitor.Visitor<T>

    public abstract class MaxIndexFinderTreeNodeVisitor<V,​K,​T extends IBaseTreeNode<V,​K,​T>>
    extends java.lang.Object
    implements io.github.astrapi69.design.pattern.visitor.Visitor<T>
    This visitor visits all ITreeNode objects and adds them to a Collection object with all descendant
    • Constructor Detail

      • MaxIndexFinderTreeNodeVisitor

        public MaxIndexFinderTreeNodeVisitor()
        Instantiates a new MergeTreeNodesVisitor object
    • Method Detail

      • visit

        public void visit​(T treeNode)
        Specified by:
        visit in interface io.github.astrapi69.design.pattern.visitor.Visitor<V>
      • isGreater

        public abstract boolean isGreater​(K id)
        Checks if the given id is greater than the current maxIndex
        Parameters:
        id - the id to check
        Returns:
        true if the given id is greater than the current maxIndex otherwise false