public class TreeList extends AbstractSequentialBridgeList<Node> implements NodeList
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<TreeList.Branch> |
branches |
protected Cloud |
cloud |
protected boolean |
foundEnd |
protected int |
leafConstraintOffset |
protected int |
max |
protected int |
numberOfSteps |
static String |
REAL_NODES |
protected int |
topQuery |
modCountNODESTEP_PROPERTY, QUERY_PROPERTY| Constructor and Description |
|---|
TreeList(NodeQuery q) |
TreeList(TreeList tl)
Copy-constructor
|
| Modifier and Type | Method and Description |
|---|---|
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<Node> |
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 |
subList(int start,
int end) |
NodeList |
subNodeList(int start,
int end)
Returns a sublist of this list.
|
String |
toString() |
TreeIterator |
treeIterator() |
protected TreeIterator |
treeIterator(int ind) |
getProperties, 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, streampublic static final String REAL_NODES
protected final Cloud cloud
protected final List<TreeList.Branch> branches
protected int topQuery
protected int numberOfSteps
protected boolean foundEnd
protected int leafConstraintOffset
protected int max
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)
public void setMax(int m)
public int getMax()
public Cloud getCloud()
public int size()
size in interface Collection<Node>size in interface List<Node>size in class AbstractCollection<Node>protected 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 bigIndexOutOfBoundsException - if queryNumber < 0protected NodeList getLeafList(int queryNumber)
public ListIterator<Node> listIterator(int ind)
listIterator in interface List<Node>listIterator in class AbstractSequentialList<Node>public NodeIterator nodeIterator()
NodeListnodeIterator in interface NodeListpublic TreeIterator treeIterator()
protected TreeIterator treeIterator(int ind)
public Node getNode(int i)
NodeListprotected Node getRealNode(int queryIndex, int index)
public NodeList subNodeList(int start, int end)
NodeListsubNodeList 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 NodeList subList(int start, int end)
subList in interface List<Node>subList in interface BridgeList<Node>subList in class AbstractSequentialBridgeList<Node>public String toString()
toString in class AbstractCollection<Node>protected static NodeQuery getQuery(String[] args)
args - the start node (in one argument)public static void main(String[] args)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}