List<ExprNode> otherChildren = otherExprNode.getChildren();
/** * Creates an enumeration over a disjunction expression branch node. * * @param node the disjunction expression branch node */ private NamingEnumeration enumDisj( BranchNode node ) throws NamingException { ArrayList children = node.getChildren(); NamingEnumeration[] childEnumerations = new NamingEnumeration[children.size()]; // Recursively create NamingEnumerations for each child expression node for ( int ii = 0; ii < childEnumerations.length; ii++ ) { childEnumerations[ii] = enumerate( ( ExprNode ) children.get( ii ) ); } return new DisjunctionEnumeration( childEnumerations ); }
if ( bnode.getChildren().size() == 0 ) if ( bnode.getChildren().size() == 1 ) ( ( ExprNode ) bnode.getChildren().get( 0 ) ).set( "count", MAX ); return; final int limit = bnode.getChildren().size(); for ( int ii = 0; ii < limit; ii++ ) ExprNode child = ( ExprNode ) bnode.getChildren().get( ii ); if ( child.isLeaf() )
List<ExprNode> children = branch.getChildren(); for ( ExprNode child:branch.getChildren() )
/** * Disjunctions (OR) are the union of candidates across all subexpressions * so we add all the counts of the child nodes. Notice that we annotate the * child node with a recursive call. * * @param node the OR branch node * @return the scan count on the OR node * @throws NamingException if there is an error */ private BigInteger getDisjunctionScan( BranchNode node ) throws NamingException { ArrayList children = node.getChildren(); BigInteger total = BigInteger.ZERO; for ( int ii = 0; ii < children.size(); ii++ ) { ExprNode child = ( ExprNode ) children.get( ii ); annotate( child ); total = total.add( ( BigInteger ) child.get( "count" ) ); } // we don't want values bigger than Integer.MAX_VALUE if ( total.compareTo( MAX ) > 0 ) { total = MAX; } return total; }
ArrayList exprNodes = branch.getChildren(); for ( int ii = 0; ii < exprNodes.size(); ii++ )
for ( ExprNode child:branch.getChildren() )
/** * ANDs or Conjunctions take the count of the smallest child as their count. * This is the best that a conjunction can do and should be used rather than * the worst case. Notice that we annotate the child node with a recursive * call before accessing its count parameter making the chain recursion * depth first. * * @param node a AND (Conjunction) BranchNode * @return the calculated scan count * @throws NamingException if there is an error */ private BigInteger getConjunctionScan( BranchNode node ) throws NamingException { BigInteger count = MAX; ArrayList children = node.getChildren(); for ( int ii = 0; ii < children.size(); ii++ ) { ExprNode child = ( ExprNode ) children.get( ii ); annotate( child ); count = ( ( BigInteger ) child.get( "count" ) ).min( count ); } return count; }
final ArrayList children = node.getChildren(); for ( int ii = 0; ii < children.size(); ii++ )
Iterator children = bnode.getChildren().iterator(); children = bnode.getChildren().iterator(); while ( children.hasNext() )
Iterator children = bnode.getChildren().iterator(); children = bnode.getChildren().iterator(); while ( children.hasNext() )
Iterator children = bnode.getChildren().iterator(); children = bnode.getChildren().iterator(); while ( children.hasNext() )
ExprNode onlyChild = ( ExprNode ) node.getChildren().get( 0 );
if ( child.getChildren().size() == 0 ) if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT )
root.getChildren().add( node ); root.getChildren().add( filter );
/** * Handle conjunction, disjunction and negation nodes and recursively call the generic matcher on children. * * @return the boolean value of the evaluation of the sub expression */ private boolean branchMatch(Attributes attributes, BranchNode branchElement) { if (branchElement.isConjunction()) { for (ExprNode child : branchElement.getChildren()) { if (!recursiveMatch(attributes, child)) { return false; } } return true; } else if (branchElement.isDisjunction()) { for (ExprNode child : branchElement.getChildren()) { if (recursiveMatch(attributes, child)) { return true; } } return false; } else if (branchElement.isNegation()) { return !recursiveMatch(attributes, branchElement.getChild()); } else { throw new DirectoryException("unsupported branching filter element type: " + branchElement.toString()); } }
for ( int ii = 0; ii < bnode.getChildren().size(); ii++ ) ExprNode child = ( ExprNode ) bnode.getChildren().get( ii ); if ( child.isLeaf() ) bnode.getChildren().remove( child ); bnode.getChildren().remove( ii ); if ( bnode.getOperator() != BranchNode.AND ) for ( int ii = 0; ii < bnode.getChildren().size(); ii++ ) ExprNode unknown = ( ExprNode ) bnode.getChildren().get( ii ); if ( !unknown.isLeaf() ) if ( child.getChildren().size() == 0 || child.get( "undefined" ) == Boolean.TRUE ) bnode.getChildren().remove( child ); if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT ) bnode.getChildren().remove( child ); if ( ii >= bnode.getChildren().size() ) bnode.getChildren().add( child.getChild() ); bnode.getChildren().add( ii, child.getChild() );
bnode.getChildren().remove( e.getUndefinedFilterNode() ); if ( bnode.getChildren().size() < 2 ) if ( child.getChildren().size() == 0 || child.get( "undefined" ) == Boolean.TRUE ) if ( child.getChildren().size() == 1 && child.getOperator() != BranchNode.NOT ) bnode.getChildren().add( filter ); filter = bnode; bnode.getChildren().add( newLeaf );
final List children = bnode.getChildren(); final int limit = children.size(); for ( int ii = 0; ii < limit; ii++ ) orNode.getChildren().add( leaf ); children.set( ii, orNode );
List<ExprNode> children = ((BranchNode)exprNode).getChildren();