Walk the component tree branch built by the composite component and locate the input container elements.

@return a composite object of the input container elements
346252
protected InputContainerElements scan(final UIComponent component, InputContainerElements elements,
            final FacesContext context) {
        if (elements == null) {
            elements = new InputContainerElements();
        }

        // NOTE we need to walk the tree ignoring rendered attribute because it's condition
        // could be based on what we discover
        if ((elements.getLabel() == null) && (component instanceof HtmlOutputLabel)) {
            elements.setLabel((HtmlOutputLabel) component);
        } else if (component instanceof EditableValueHolder) {
            elements.registerInput((EditableValueHolder) component, getDefaultValidator(context), context);
        } else if (component instanceof UIMessage) {
            elements.registerMessage((UIMessage) component);
        }
        // may need to walk smarter to ensure "element of least suprise"
        for (UIComponent child : component.getChildren()) {
            scan(child, elements, context);
        }

        return elements;
    }
1289384
public IntList getRoots() {
    IntList roots = new IntArrayList();
    for(int i = 0; i < used; i++) {
      // roots or one element in component
      if(parent[i] == i) {
        roots.add(i);
      }
    }
    return roots;
  }
1296500
public ITreeData getNode() {
        if (lastPointer.get(mRTX) != null && lastPointer.get(mRTX) < 0) {
            return atomics.get(mRTX).getItem(lastPointer.get(mRTX));
        } else {
            return mRTX.getNode();
        }
    }
713079
public Map<?, ?> getByType() {

        if (m_byType == null) {
            m_byType = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                @SuppressWarnings("synthetic-access")
                public Object transform(Object arg0) {

                    String key = (String)arg0;
                    List<CmsContainerElementBean> result = Lists.newArrayList();
                    for (Map.Entry<String, CmsContainerBean> entry : getPage().getContainers().entrySet()) {
                        CmsContainerBean value = entry.getValue();
                        for (CmsContainerElementBean element : value.getElements()) {
                            try {
                                element.initResource(m_cms);
                                if (key.equals(element.getTypeName())) {
                                    result.add(element);
                                }
                            } catch (CmsException e) {
                                LOG.error(
                                    "Could not initialize resource with site path \""
                                        + element.getSitePath()
                                        + "\" to determine the container elements type.",
                                    e);
                            }
                        }
                    }
                    return result;
                }
            });
        }
        return m_byType;
    }
688928
public Query build() {
            Query.Builder root = this;
            while (true) {
                if (root.parent == null) {
                    break;
                }
                root = root.parent;
            }

            root.done();
            return root.tree;
        }
1364093
def _internal_build(self):
        
        self.nodes = self.__tree.Nodes()
        self.edges = self.__tree.Edges()
        self.augmentedEdges = {}
        for key, val in self.__tree.AugmentedEdges().items():
            self.augmentedEdges[key] = list(val)
        self.root = self.__tree.Root()

        seen = set()
        self.branches = set()

        # Find all of the branching nodes in the tree, degree > 1
        # That is, they appear in more than one edge
        for e1, e2 in self.edges:
            if e1 not in seen:
                seen.add(e1)
            else:
                self.branches.add(e1)

            if e2 not in seen:
                seen.add(e2)
            else:
                self.branches.add(e2)

        # The nodes that are not branches are leaves
        self.leaves = set(self.nodes.keys()) - self.branches
        self.leaves.remove(self.root)
1287758
public Node nextNode() {

		if (currentNode == null)
			return null;

		Node result = getFirstChild(currentNode);

		if (result != null) {
			currentNode = result;
			return result;
		}

		result = getNextSibling(currentNode);

		if (result != null) {
			currentNode = result;
			return result;
		}

		// return parent's 1st sibling.
		Node parent = getParentNode(currentNode);
		while (parent != null) {
			result = getNextSibling(parent);
			if (result != null) {
				currentNode = result;
				return result;
			} else {
				parent = getParentNode(parent);
			}
		}

		// end , return null
		return null;
	}
1274167
public IAtomContainer getSpanningTree() {
        IAtomContainer container = molecule.getBuilder().newInstance(IAtomContainer.class);
        for (int a = 0; a < totalVertexCount; a++)
            container.addAtom(molecule.getAtom(a));
        for (int b = 0; b < totalEdgeCount; b++)
            if (bondsInTree[b]) container.addBond(molecule.getBond(b));
        return container;
    }
947962
@Override
    public List<ComponentType> children() {
        synchronized (this) {
            List<ComponentType> children = new ArrayList<ComponentType>();
            for (ComponentVertex child : this.children) {
                children.add(child.component());
            }
            return Collections.unmodifiableList(children);
        }
    }
202680
public Tree tree() throws ScanException, ParseException {
		consumeToken();
		AstNode t = text();
		if (token.getSymbol() == EOF) {
			if (t == null) {
				t = new AstText("");
			}
			return new Tree(t, functions, identifiers, false);
		}
		AstEval e = eval();
		if (token.getSymbol() == EOF && t == null) {
			return new Tree(e, functions, identifiers, e.isDeferred());
		}
		ArrayList<AstNode> list = new ArrayList<AstNode>();
		if (t != null) {
			list.add(t);
		}
		list.add(e);
		t = text();
		if (t != null) {
			list.add(t);
		}
		while (token.getSymbol() != EOF) {
			if (e.isDeferred()) {
				list.add(eval(true, true));
			} else {
				list.add(eval(true, false));
			}
			t = text();
			if (t != null) {
				list.add(t);
			}
		}
		return new Tree(createAstComposite(list), functions, identifiers, e.isDeferred());
	}
1234450
@SuppressWarnings("unchecked")
  public V getComponent() {
	if (this.component == null) {
	  try {
		this.component =
			(V) Application.getControllerManager().getComponentBuilder()
				.build(this);
	  } catch (Exception e) {
		throw new ControllerException("Component Build Error", e);
	  }

	  if (this.component == null) {
		throw new ControllerException("NULL Component.");
	  }
	}
	return this.component;
  }
338871
@Pure
	public Object getTopContainer() {
		if (this.mapContainer == null) {
			return null;
		}
		final C container = this.mapContainer.get();
		if (container == null) {
			return null;
		}
		if (container instanceof GISContentElement<?>) {
			return ((GISContentElement<?>) container).getTopContainer();
		}
		return container;
	}
32325
@Override
  public Node next() {
    Node cur = next;
    next = next.getNextSibling();
    return cur;
  }
784797
public Tree getNextSibling() {
		if (parent != null && key != null) {
			if (key instanceof Integer) {
				int idx = (int) key;
				if (parent.size() >= idx - 1) {
					return null;
				}
				return parent.get(idx + 1);
			}
			boolean found = false;
			for (Tree child : parent) {
				if (key.equals(child.key)) {
					found = true;
					continue;
				}
				if (found) {
					return child;
				}
			}
		}
		return null;
	}
674785
public Set<Map.Entry<String, V>> entrySet()
    {
        Set<Map.Entry<String, V>> entrySet = new TreeSet<Map.Entry<String, V>>();
        StringBuilder sb = new StringBuilder();
        for (BaseNode node : child)
        {
            if (node == null) continue;
            node.walk(new StringBuilder(sb.toString()), entrySet);
        }
        return entrySet;
    }
507586
public List<IntArrayList> findComponents() {
        int nodes = graph.getNodes();
        for (int start = 0; start < nodes; start++) {
            if (nodeIndex[start] == 0
                    && !ignoreSet.contains(start)
                    && !graph.isNodeRemoved(start))
                strongConnect(start);
        }

        return components;
    }
267546
def branch(self):
        
        branch = [self]
        for c in self.children:
            branch += c.branch()
        return branch