fe/src/main/java/com/cloudera/impala/common/TreeNode.java
/**
   * Add all nodes in the tree that satisfy 'predicate' to the list 'matches'
   * This node is checked first, followed by its children in order. If the node
   * itself matches, the children are skipped.
   */
Add all nodes in the tree that satisfy 'predicate' to the list 'matches'
This node is checked first, followed by its children in order. If the node
itself matches, the children are skipped.
Add all nodes in the tree that satisfy ' predicate ' to the list ' matches ' This node is checked first followed by its children in order . If the node itself matches the children are skipped .
public <C extends TreeNode<NodeType>, D extends C> void collect(
      Predicate<? super C> predicate, List<D> matches) {
    if (predicate.apply((C) this) && !matches.contains(this)) {
      matches.add((D) this);
      return;
    }
    for (NodeType child: children_) {
      child.collect(predicate, matches);
    }
  }
public < C extends TreeNode < NodeType > , D extends C > void collect ( Predicate < ? super C > predicate , List < D > matches ) { if ( predicate . apply ( ( C ) this ) && ! matches . contains ( this ) ) { matches . add ( ( D ) this ) ; return ; } for ( NodeType child : children_ ) { child . collect ( predicate , matches ) ; } }
Add all nodes in the tree that satisfy 'predicate' to the list 'matches'
 This node is checked first, followed by its children in order.
Add all nodes in the tree that satisfy ' predicate ' to the list ' matches ' This node is checked first followed by its children in order .