Module de.cuioss.test.generator
Class AbstractTreeGenerator<T>
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>
Base class for tree generators.
The callback order is:
createNode(): create current nodegetChildCount(int, int): calculate number of child nodes- (create child nodes)
addChildren(Object, List): add child nodes to node
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddChildren(T node, List<T> children) Add the created children to the parent node.protected abstract TCreate a node of type T.protected abstract intgetChildCount(int level, int numberOfSiblings) Get the number of children for the current level.next()Generates the next instance.
-
Field Details
-
MAX_TREE_DEPTH
- See Also:
-
-
Constructor Details
-
AbstractTreeGenerator
public AbstractTreeGenerator()
-
-
Method Details
-
createNode
Create a node of type T. -
addChildren
Add the created children to the parent node. -
getChildCount
Get the number of children for the current level.- Parameters:
level- current level starting with 0 for the root levelnumberOfSiblings- number of siblings (number of siblings is 1 for the root node.)
-
next
Description copied from interface:GeneratorGenerates the next instance.
-