/** * @see Evaluator#evaluate(ExprNode, String, Attributes) */ public boolean evaluate( ExprNode node, String dn, Attributes entry ) throws NamingException { if ( node instanceof ScopeNode ) { return scopeEvaluator.evaluate( node, dn, entry ); } switch ( ( ( LeafNode ) node ).getAssertionType() ) { case ( LeafNode.APPROXIMATE ): return evalEquality( ( SimpleNode ) node, entry ); case ( LeafNode.EQUALITY ): return evalEquality( ( SimpleNode ) node, entry ); case ( LeafNode.EXTENSIBLE ): throw new NotImplementedException(); case ( LeafNode.GREATEREQ ): return evalGreater( ( SimpleNode ) node, entry, true ); case ( LeafNode.LESSEQ ): return evalGreater( ( SimpleNode ) node, entry, false ); case ( LeafNode.PRESENCE ): String attrId = ( ( PresenceNode ) node ).getAttribute(); return evalPresence( attrId, entry ); case ( LeafNode.SUBSTRING ): return substringEvaluator.evaluate( node, dn, entry ); default: throw new NamingException( "Unrecognized leaf node type: " + ( ( LeafNode ) node ).getAssertionType() ); } }
/** * @see org.apache.directory.server.core.partition.impl.btree.Evaluator#evaluate(ExprNode, IndexRecord) */ public boolean evaluate( ExprNode node, IndexRecord record ) throws NamingException { if ( node instanceof ScopeNode ) { return scopeEvaluator.evaluate( node, record ); } switch ( ( ( LeafNode ) node ).getAssertionType() ) { case ( LeafNode.APPROXIMATE ): return evalEquality( ( SimpleNode ) node, record ); case ( LeafNode.EQUALITY ): return evalEquality( ( SimpleNode ) node, record ); case ( LeafNode.EXTENSIBLE ): throw new NotImplementedException(); case ( LeafNode.GREATEREQ ): return evalGreater( ( SimpleNode ) node, record, true ); case ( LeafNode.LESSEQ ): return evalGreater( ( SimpleNode ) node, record, false ); case ( LeafNode.PRESENCE ): String attrId = ( ( PresenceNode ) node ).getAttribute(); return evalPresence( attrId, record ); case ( LeafNode.SUBSTRING ): return substringEvaluator.evaluate( node, record ); default: throw new NamingException( "Unrecognized leaf node type: " + ( ( LeafNode ) node ).getAssertionType() ); } }
switch ( leaf.getAssertionType() )
AttributeType descendant = ( AttributeType ) descendants.next(); switch( leaf.getAssertionType() ) default: throw new IllegalStateException( "Unknown assertion type: " + leaf.getAssertionType() );
AttributeType descendant = ( AttributeType ) descendants.next(); switch( leaf.getAssertionType() ) default: throw new IllegalStateException( "Unknown assertion type: " + leaf.getAssertionType() );