| org.mmbase.bridge.util.TreeList
All known Subclasses: org.mmbase.bridge.util.GrowingTreeList,
TreeList | public class TreeList extends AbstractSequentialBridgeList implements NodeList(Code) | | 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 of these lists as if it was one
list ordered as a Tree.
author: Michiel Meeuwissen version: $Id: TreeList.java,v 1.30 2008/02/28 12:23:51 michiel Exp $ since: MMBase-1.7 |
Inner Class :protected class Branch | |
Inner Class :protected class TreeItr implements TreeIterator | |
Method Summary | |
public static void | doTest(java.io.Writer writer, NodeQuery q) | public Cloud | getCloud() | protected NodeList | getLeafList(int queryNumber) Executes one query as a 'leaf' query. | public NodeQuery | getLeafQuery() Returns the top most query, associated with the last call to
TreeList.grow . | protected NodeList | getList(int queryNumber) | public int | getMax() | public Node | getNode(int i) | protected static NodeQuery | getQuery(String[] args) For testing only. | protected Node | getRealNode(int queryIndex, int index) | public RelationStep | grow(NodeManager nodeManager, String role, String searchDir) Grows branches of the Tree, which means that one new query will be created which is one
relationStep longer than the longest one until now. | public ListIterator<Node> | listIterator(int ind) | public static void | main(String[] args) | public NodeIterator | nodeIterator() | public void | setLeafConstraint(Constraint constraint) Sets a 'leaf constraint' on the last 'growed' step. | public void | setMax(int m) | public int | size() | protected void | sizeCheck() Checks if the size of the List needs to be (re)determined, and if not, does so. | public NodeList | subList(int start, int end) | public NodeList | subNodeList(int start, int end) | public String | toString() | public TreeIterator | treeIterator() | protected TreeIterator | treeIterator(int ind) |
branches | final protected List<Branch> branches(Code) | | |
foundEnd | protected boolean foundEnd(Code) | | |
leafConstraintOffset | protected int leafConstraintOffset(Code) | | |
max | protected int max(Code) | | since: MMBase-1.8.1 |
numberOfSteps | protected int numberOfSteps(Code) | | |
topQuery | protected int topQuery(Code) | | |
TreeList | public TreeList(NodeQuery q)(Code) | | Parameters: q - The 'base' query defining the minimal depth of the tree elements. The trunk of the tree. |
TreeList | public TreeList(TreeList tl)(Code) | | Copy-constructor
since: MMBase-1.8 |
getLeafList | protected NodeList getLeafList(int queryNumber)(Code) | | Executes one query as a 'leaf' query.
since: MMBase-1.8 |
getLeafQuery | public NodeQuery getLeafQuery()(Code) | | Returns the top most query, associated with the last call to
TreeList.grow .
since: MMBase-1.8 |
getList | protected NodeList getList(int queryNumber)(Code) | | Executes one query if that did not happen yet, and stores the result in the 'results' List
NodeList or null if queryNumber too big throws: IndexOutOfBoundsException - if queryNumber < 0 |
getMax | public int getMax()(Code) | | since: MMBase-1.8.1 |
getQuery | protected static NodeQuery getQuery(String[] args)(Code) | | For testing only. Based on RMMCI,
please use the System property to specify de cloud context
-Dmmbase.defaultcloudcontext=rmi://localhost:1111/remotecontext
Parameters: args - the start node (in one argument) |
getRealNode | protected Node getRealNode(int queryIndex, int index)(Code) | | Returns node 'index' of query result 'queryIndex' as a 'real' node (so not a cluster node)
|
grow | public RelationStep grow(NodeManager nodeManager, String role, String searchDir)(Code) | | Grows branches of the Tree, which means that one new query will be created which is one
relationStep longer than the longest one until now.
This new relationStep is returned, which can be used to create new constraints.
null if no relationstep is added because that would not increase the number of results. |
setLeafConstraint | public void setLeafConstraint(Constraint constraint)(Code) | | Sets a 'leaf constraint' on the last 'growed' step. A leaf constraint is a constraint which is only
used on leafs, so if the tree is grown further, the leaf constraint will not be passed to the branches.
since: MMBase-1.8 |
setMax | public void setMax(int m)(Code) | | since: MMBase-1.8.1 |
sizeCheck | protected void sizeCheck()(Code) | | Checks if the size of the List needs to be (re)determined, and if not, does so. After growing
a List the size needs recalculation.
since: MMBase-1.7.1 |
|
|