1 26 27 package com.opensugar.cube.ldap; 28 29 import java.util.Dictionary ; 30 31 public class SuperClauseAND extends SuperClause { 32 33 public SuperClauseAND( Clause[] clauses ) { 34 super( clauses ); 35 } 36 37 public boolean filter( Dictionary props ) { 38 Clause[] clauses = getClauses(); 39 for ( int i = 0; i < clauses.length; i++ ) { 40 if ( !clauses[ i ].filter( props ) ) { 41 return false; 42 } 43 } 44 return true; 45 } 46 47 public String getCanonicalForm() { 48 StringBuffer sb = new StringBuffer (); 49 sb.append( "(" + Filter.AND ); 50 Clause[] clauses = getClauses(); 51 for ( int i = 0; i < clauses.length; i++ ) { 52 sb.append( clauses[ i ].getCanonicalForm() ); 53 } 54 sb.append( ")" ); 55 return sb.toString(); 56 } 57 58 } 59 | Popular Tags |