Class AbstractTreeGenerator<T>

    • Method Detail

      • createNode

        protected abstract T createNode()
        Create a node of type T.
      • addChildren

        protected abstract void addChildren​(T node,
                                            List<T> children)
        Add the created children to the parent node.
      • getChildCount

        protected abstract int getChildCount​(int level,
                                             int numberOfSiblings)
        Get the number of children for the current level.
        Parameters:
        level - current level starting with 0 for the root level
        numberOfSiblings - number of siblings (number of siblings is 1 for the root node.)
      • next

        public T next()
        Description copied from interface: Generator
        Generates the next instance.
        Specified by:
        next in interface Generator<T>
        Returns:
        root node of the generated tree