org.mmbase.bridge.util
Class GrowingTreeList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
org.mmbase.bridge.util.AbstractSequentialBridgeList
org.mmbase.bridge.util.TreeList
org.mmbase.bridge.util.GrowingTreeList
- All Implemented Interfaces:
- BridgeList, java.util.Collection, java.util.List, NodeList
- public class GrowingTreeList
- extends TreeList
Queries a Tree from MMBase. A Tree is presented as a List of MultiLevel results (ClusterNodes),
combined with a smart iterator which iterates through the elements these lists as if it was one
list ordered as a Tree.
- Since:
- MMBase-1.7
- Version:
- $Id: GrowingTreeList.java,v 1.2.2.3 2004/07/29 17:19:42 michiel Exp $
- Author:
- Michiel Meeuwissen
| Fields inherited from class java.util.AbstractList |
modCount |
|
Method Summary |
protected void |
addPathElement()
|
protected NodeList |
getList(int queryNumber)
Executes one query if that did not happen yet, and stores the result in the 'results' List |
Query |
getTemplate()
Returns the Query which is used as a template to 'grow' the query. |
static void |
main(java.lang.String[] args)
|
void |
setMaxDepth(int maxDepth)
As long as the tree is not 'started' yet, max depth can still be changed. |
int |
size()
|
| Methods inherited from class org.mmbase.bridge.util.TreeList |
doTest, getNode, getQuery, getRealNode, grow, listIterator, nodeIterator, sizeCheck, subNodeList, toString, treeIterator |
| Methods inherited from class java.util.AbstractSequentialList |
add, addAll, get, iterator, remove, set |
| Methods inherited from class java.util.AbstractList |
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
cleanConstraint
protected Constraint cleanConstraint
pathElementTemplate
protected NodeQuery pathElementTemplate
maxNumberOfSteps
protected int maxNumberOfSteps
GrowingTreeList
public GrowingTreeList(NodeQuery q,
int maxDepth,
NodeManager nodeManager,
java.lang.String role,
java.lang.String searchDir)
- Parameters:
q - The 'base' query defining the minimal depth of the tree elementsmaxDepth - 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.role - searchDir - - Since:
- MMBase-1.7.1
GrowingTreeList
public GrowingTreeList(NodeQuery q,
int maxDepth)
setMaxDepth
public void setMaxDepth(int maxDepth)
- As long as the tree is not 'started' yet, max depth can still be changed.
- Since:
- MMBase-1.7.1
getTemplate
public Query getTemplate()
- Returns the Query which is used as a template to 'grow' the query. You can change it, add sort-orders and add constraints before
the tree is 'started'.
All but the first step of this query are added. This query itself is never used.
- Since:
- MMBase-1.7.1
size
public int size()
- Specified by:
size in interface java.util.List- Overrides:
size in class TreeList
getList
protected NodeList getList(int queryNumber)
- Description copied from class:
TreeList
- Executes one query if that did not happen yet, and stores the result in the 'results' List
- Overrides:
getList in class TreeList
- Returns:
- NodeList or null if queryNumber too big
addPathElement
protected void addPathElement()
main
public static void main(java.lang.String[] args)
MMBase build 1.7.1.20041002