1 26 27 package com.opensugar.cube.ldap; 28 29 import java.util.Dictionary ; 30 import java.util.Vector ; 31 32 public class LessThanClause extends SimpleClause { 33 34 public LessThanClause( String key, String value, boolean keysCaseSensitive ) { 35 super( key, value, keysCaseSensitive ); 36 } 37 38 public boolean filter( Dictionary props ) { 39 Object obj = getProperty( getKey(), props ); 40 if ( obj == null ) { 41 return false; 42 } 43 44 if ( obj instanceof Object [] || obj instanceof Vector ) { 45 int[] result = compareSets( obj, getValue() ); 46 int ret = Integer.MAX_VALUE; 47 for ( int i = 0; i < result.length; i++ ) { 48 if ( result[ i ] < ret ) { 49 ret = result[ i ]; 50 } 51 } 52 return ret < EPS; 53 } 54 55 return compare( obj, getValue() ) < EPS; 56 } 57 58 public String getCanonicalForm() { 59 return "(" + getKey() + Filter.LESS + getValue() + ")"; 60 } 61 62 } | Popular Tags |