public String toString() { StringBuilder sb=new StringBuilder(); int indent=0; Map children; children=root.getChildren(); if(children != null && !children.isEmpty()) { Collection nodes=children.values(); for(Iterator it=nodes.iterator(); it.hasNext();) { ((Node)it.next()).print(sb, indent); sb.append('\n'); } } else sb.append(SEPARATOR); return sb.toString(); }
/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }
/** * Returns all children of a given node * @param fqn The fully qualified name of the node * @return Set A list of child names (as Strings) */ public Set getChildrenNames(String fqn) { Node n=findNode(fqn); Map m; if(n == null) return null; m=n.getChildren(); if(m != null) return m.keySet(); else return null; }
public String toString() { StringBuilder sb=new StringBuilder(); int indent=0; Map children; children=root.getChildren(); if(children != null && !children.isEmpty()) { Collection nodes=children.values(); for(Iterator it=nodes.iterator(); it.hasNext();) { ((Node)it.next()).print(sb, indent); sb.append('\n'); } } else sb.append(SEPARATOR); return sb.toString(); }
/** * Returns all children of a given node * @param fqn The fully qualified name of the node * @return Set A list of child names (as Strings) */ public Set getChildrenNames(String fqn) { Node n=findNode(fqn); Map m; if(n == null) return null; m=n.getChildren(); if(m != null) return m.keySet(); else return null; }
public String toString() { StringBuffer sb=new StringBuffer(); int indent=0; Map children; children=root.getChildren(); if(children != null && children.size() > 0) { Collection nodes=children.values(); for(Iterator it=nodes.iterator(); it.hasNext();) { ((Node)it.next()).print(sb, indent); sb.append('\n'); } } else sb.append(SEPARATOR); return sb.toString(); }
/** * Returns all children of a given node * @param fqn The fully qualified name of the node * @return Set A list of child names (as Strings) */ public Set getChildrenNames(String fqn) { Node n=findNode(fqn); Map m; if(n == null) return null; m=n.getChildren(); if(m != null) return m.keySet(); else return null; }
/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }
/** Generates NodeAdded notifications for all nodes of the tree. This is called whenever the tree is initially retrieved (state transfer) */ void notifyAllNodesCreated(Node curr) { Node n; Map children; if(curr == null) return; notifyNodeAdded(curr.fqn); if((children=curr.getChildren()) != null) { for(Iterator it=children.values().iterator(); it.hasNext();) { n=(Node)it.next(); notifyAllNodesCreated(n); } } }