java.lang.Object
de.cuioss.test.generator.internal.net.java.quickcheck.generator.support.AbstractTreeGenerator<T>
Type Parameters:
T - type of tree node
All Implemented Interfaces:
Generator<T>

public abstract class AbstractTreeGenerator<T> extends Object implements Generator<T>
Base class for tree generators.

The callback order is:

  • Field Details

  • Constructor Details

  • Method Details

    • 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