Lines Matching defs:children

43  * A tree node may have at most one parent and 0 or more children.
45 * node's parent and children and also operations for examining the tree that
48 * parents and children. A node with no parent is the root of its tree; a
49 * node with no children is a leaf. A tree may consist of many subtrees,
94 * of a leaf node's children is requested.
102 /** array of children, may be null if this node has no children */
103 protected Vector children;
108 /** true if the node is able to have children */
113 * Creates a tree node that has no parent and no children, but which
114 * allows children.
121 * Creates a tree node with no parent, no children, but which allows
122 * children, and initializes it with the specified user object.
132 * Creates a tree node with no parent, no children, initialized with
133 * the specified user object, and that allows children only if
169 * children
174 throw new IllegalStateException("node does not allow children");
187 if (children == null) {
188 children = new Vector();
190 children.insertElementAt(newChild, childIndex);
194 * Removes the child at the specified index from this node's children
205 children.removeElementAt(childIndex);
240 if (children == null) {
241 throw new ArrayIndexOutOfBoundsException("node has no children");
243 return (TreeNode)children.elementAt(index);
247 * Returns the number of children of this node.
249 * @return an int giving the number of children of this node
252 if (children == null) {
255 return children.size();
263 * where n is the number of children.
265 * @param aChild the TreeNode to search for among this node's children
280 return children.indexOf(aChild); // linear search
285 * children. Modifying this node's child array invalidates any child
288 * @return an Enumeration of this node's children
290 public Enumeration children() {
291 if (children == null) {
294 return children.elements();
299 * Determines whether or not this node is allowed to have children.
300 * If <code>allows</code> is false, all of this node's children are
303 * Note: By default, a node allows children.
305 * @param allows true if this node is allowed to have children
317 * Returns true if this node is allowed to have children.
319 * @return true if this node allows children, else false
385 * Removes all of this node's children, setting their parents to null.
386 * If this node has no children, this method does nothing.
403 * children
449 * -- if it is this node, one of this node's children, or a descendant of
450 * one of this node's children. Note that a node is considered a
546 * distance from this node to a leaf. If this node has no children,
693 // No children, so look for nextSibling
869 * Returns this node's first child. If this node has no children,
873 * @exception NoSuchElementException if this node has no children
877 throw new NoSuchElementException("node has no children");
884 * Returns this node's last child. If this node has no children,
888 * @exception NoSuchElementException if this node has no children
892 throw new NoSuchElementException("node has no children");
902 * performs a linear search of this node's children for
903 * <code>aChild</code> and is O(n) where n is the number of children; to
904 * traverse the entire array of children, use an enumeration instead.
906 * @see #children
935 * performs a linear search of this node's children for <code>aChild</code>
936 * and is O(n) where n is the number of children.
1015 * Returns the next sibling of this node in the parent's children array.
1018 * of children; to traverse the entire array, use the parent's child
1021 * @see #children
1044 * Returns the previous sibling of this node in the parent's children
1047 * is the number of children.
1076 * Returns true if this node has no children. To distinguish between
1077 * nodes that have no children and nodes that <i>cannot</i> have
1078 * children (e.g. to distinguish files from empty directories), use this
1082 * @return true if this node has no children
1248 * the new node has no parent or children and has a reference to the same
1259 // shallow copy -- the new node has no parent or children
1260 newNode.children = null;
1317 Enumeration children = node.children();
1322 if (children.hasMoreElements()) {
1323 stack.push(children);
1334 protected Enumeration<TreeNode> children;
1340 children = root.children();
1353 } else if (children.hasMoreElements()) {
1354 subtree = new PostorderEnumeration(children.nextElement());
1387 Enumeration children = node.children();
1392 if (children.hasMoreElements()) {
1393 queue.enqueue(children);