|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
org.mmbase.bridge.util.AbstractSequentialBridgeList
org.mmbase.bridge.util.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 of these lists as if it was one list ordered as a Tree.
| Nested Class Summary | |
protected class |
TreeList.Branch
Structure to hold the information for every branch-depth. |
protected class |
TreeList.TreeItr
The TreeIterator contains the core-functionality of TreeList. |
| Field Summary | |
protected List |
branches
|
protected Cloud |
cloud
|
protected boolean |
foundEnd
|
protected int |
leafConstraintOffset
|
protected int |
max
|
protected int |
numberOfSteps
|
static String |
REAL_NODES
|
protected int |
topQuery
|
| Fields inherited from class java.util.AbstractList |
modCount |
| Fields inherited from interface org.mmbase.bridge.NodeList |
NODESTEP_PROPERTY, QUERY_PROPERTY |
| Constructor Summary | |
TreeList(NodeQuery q)
|
|
TreeList(TreeList tl)
Copy-constructor |
|
| Method Summary | |
static void |
doTest(Writer writer,
NodeQuery q)
|
Cloud |
getCloud()
|
protected NodeList |
getLeafList(int queryNumber)
Executes one query as a 'leaf' query. |
NodeQuery |
getLeafQuery()
Returns the top most query, associated with the last call to grow(org.mmbase.bridge.NodeManager, java.lang.String, java.lang.String). |
protected NodeList |
getList(int queryNumber)
Executes one query if that did not happen yet, and stores the result in the 'results' List |
int |
getMax()
|
Node |
getNode(int i)
Returns the Node at the indicated postion in the list |
protected static NodeQuery |
getQuery(String[] args)
For testing only. |
protected Node |
getRealNode(int queryIndex,
int index)
Returns node 'index' of query result 'queryIndex' as a 'real' node (so not a cluster node) |
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. |
ListIterator |
listIterator(int ind)
|
static void |
main(String[] args)
|
NodeIterator |
nodeIterator()
Returns an type-specific iterator for this list. |
void |
setLeafConstraint(Constraint constraint)
Sets a 'leaf constraint' on the last 'growed' step. |
void |
setMax(int m)
|
int |
size()
|
protected void |
sizeCheck()
Checks if the size of the List needs to be (re)determined, and if not, does so. |
NodeList |
subNodeList(int start,
int end)
Returns a sublist of this list. |
String |
toString()
|
TreeIterator |
treeIterator()
|
protected TreeIterator |
treeIterator(int ind)
|
| Methods inherited from class org.mmbase.bridge.util.AbstractSequentialBridgeList |
getProperty, setProperty, sort, sort |
| 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 org.mmbase.bridge.BridgeList |
getProperty, setProperty, sort, sort |
| 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 |
| Field Detail |
public static final String REAL_NODES
protected Cloud cloud
protected final List branches
protected int topQuery
protected int numberOfSteps
protected boolean foundEnd
protected int leafConstraintOffset
protected int max
| Constructor Detail |
public TreeList(NodeQuery q)
q - The 'base' query defining the minimal depth of the tree elements. The trunk of the tree.public TreeList(TreeList tl)
| Method Detail |
public void setMax(int m)
public int getMax()
public Cloud getCloud()
public int size()
size in interface Listprotected void sizeCheck()
public RelationStep grow(NodeManager nodeManager,
String role,
String searchDir)
null if no relationstep is added because that would not increase the number of results.public NodeQuery getLeafQuery()
grow(org.mmbase.bridge.NodeManager, java.lang.String, java.lang.String).
public void setLeafConstraint(Constraint constraint)
protected NodeList getList(int queryNumber)
null if queryNumber too big
IndexOutOfBoundsException - if queryNumber < 0protected NodeList getLeafList(int queryNumber)
public ListIterator listIterator(int ind)
listIterator in interface Listpublic NodeIterator nodeIterator()
NodeList
nodeIterator in interface NodeListpublic TreeIterator treeIterator()
protected TreeIterator treeIterator(int ind)
public Node getNode(int i)
NodeList
getNode in interface NodeListi - the position of the Node to retrieve
protected Node getRealNode(int queryIndex,
int index)
public NodeList subNodeList(int start,
int end)
NodeList
subNodeList in interface NodeListstart - the position in the current list where the sublist starts (inclusive)end - the position in the current list where the sublist ends (exclusive)
public String toString()
protected static NodeQuery getQuery(String[] args)
args - the start node (in one argument)
public static void doTest(Writer writer,
NodeQuery q)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||