|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.quickcheck.generator.support.AbstractTreeGenerator<T>
T
- type of tree nodepublic abstract class AbstractTreeGenerator<T>
Base class for tree generators.
The callback order is:
createNode()
: create current node getChildCount(int, int)
: calculate number
of child nodesaddChildren(Object, List)
: add child
nodes to node
Field Summary | |
---|---|
static int |
MAX_TREE_DEPTH
|
Constructor Summary | |
---|---|
AbstractTreeGenerator()
|
Method Summary | |
---|---|
protected abstract void |
addChildren(T node,
List<T> children)
Add the created children to the parent node. |
protected abstract T |
createNode()
Create a node of type T. |
protected abstract int |
getChildCount(int level,
int numberOfSiblings)
Get the number of children for the current level. |
T |
next()
Generates the next instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_TREE_DEPTH
Constructor Detail |
---|
public AbstractTreeGenerator()
Method Detail |
---|
protected abstract T createNode()
protected abstract void addChildren(T node, List<T> children)
protected abstract int getChildCount(int level, int numberOfSiblings)
level
- current level starting with 0 for the root levelnumberOfSiblings
- number of siblings (number of siblings is 1 for the root
node.)public T next()
Generator
next
in interface Generator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |