1 26 27 package com.opensugar.cube.ldap; 28 29 import java.util.Dictionary ; 30 31 public class SuperClauseOR extends SuperClause { 32 33 public SuperClauseOR( 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 true; 42 } 43 } 44 return false; 45 } 46 47 public String getCanonicalForm() { 48 StringBuffer sb = new StringBuffer (); 49 sb.append( "(" + Filter.OR ); 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 } | Popular Tags |