public class GrowingTreeList extends TreeList
TreeList is automaticly growing with the same 'branch' every time when that is possible. For that
it needs a kind of template query for every branch, which is defined by the constructor.TreeList.Branch, TreeList.TreeItr| Modifier and Type | Field and Description |
|---|---|
protected Constraint |
cleanConstraint |
protected Constraint |
cleanLeafConstraint |
protected NodeQuery |
leafElementTemplate |
protected int |
maxNumberOfSteps |
protected NodeQuery |
pathElementTemplate |
branches, cloud, foundEnd, leafConstraintOffset, max, numberOfSteps, REAL_NODES, topQuerymodCountNODESTEP_PROPERTY, QUERY_PROPERTY| Constructor and Description |
|---|
GrowingTreeList(NodeQuery q,
int maxDepth)
This may be used in combination with
Queries.addPath(tree.getTemplate(), (String) path.getValue(this), (String) searchDirs.getValue(this));
So you add a template constisting of a bunch of elements. |
GrowingTreeList(NodeQuery q,
int maxDepth,
NodeManager nodeManager,
String role,
String searchDir) |
GrowingTreeList(TreeList tl,
int maxDepth) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPathElement()
Grows the branches of the tree, with the leave.
|
protected NodeList |
getLeafList(int queryNumber)
Executes one query as a 'leaf' query.
|
NodeQuery |
getLeafTemplate()
The leave template is the 'last' template.
|
protected NodeList |
getList(int queryNumber)
Executes one query if that did not happen yet, and stores the result in the 'results' List
|
NodeQuery |
getTemplate()
Returns the Query which is used as a template for the leaves to 'grow' the query.
|
static void |
main(String[] args) |
void |
setMaxDepth(int maxDepth)
As long as the tree is not 'started' yet, max depth can still be changed.
|
int |
size() |
doTest, getCloud, getLeafQuery, getMax, getNode, getQuery, getRealNode, grow, listIterator, nodeIterator, setLeafConstraint, setMax, sizeCheck, subList, subNodeList, toString, treeIterator, treeIteratorgetProperties, getProperty, setProperty, sort, sortadd, addAll, get, iterator, remove, setadd, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRangeaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetProperties, getProperty, setProperty, sort, sortadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, spliterator, toArray, toArrayparallelStream, removeIf, streamprotected Constraint cleanConstraint
protected NodeQuery pathElementTemplate
protected Constraint cleanLeafConstraint
protected NodeQuery leafElementTemplate
protected int maxNumberOfSteps
public GrowingTreeList(NodeQuery q, int maxDepth, NodeManager nodeManager, String role, String searchDir)
q - The 'base' query defining the minimal depth of the tree elements. The trunk of the tree.maxDepth - You must supply a maximal depth of the nodes, because MMBase is basicly a network rather then a tree, so
tree representations could be infinitely deep.nodeManager - Destination Nodemanager in the treerole - Role of the relations in the treesearchDir - Direction of the relations in the treepublic GrowingTreeList(NodeQuery q, int maxDepth)
Queries.addPath(tree.getTemplate(), (String) path.getValue(this), (String) searchDirs.getValue(this));
So you add a template constisting of a bunch of elements.public GrowingTreeList(TreeList tl, int maxDepth)
public void setMaxDepth(int maxDepth)
maxDepth - max number of Stepspublic NodeQuery getTemplate()
public NodeQuery getLeafTemplate()
public int size()
protected NodeList getList(int queryNumber)
TreeListprotected NodeList getLeafList(int queryNumber)
TreeListgetLeafList in class TreeListprotected void addPathElement()
public static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}