public boolean matches ( ConditionTerm conditionTerm ) { int numberOfItemsToMatch = 0 ; boolean match = true ; Enumeration factors = getConditionFactors ( ) ; while ( match && factors . hasMoreElements ( ) ) { ConditionFactor factor = ( ConditionFactor ) factors . nextElement ( ) ; if ( factor . not ( ) ) { match = ! conditionTerm . contains ( factor ) ; } else { match = conditionTerm . contains ( factor ) ; numberOfItemsToMatch ++ ; } } match = match && numberOfItemsToMatch == conditionTerm . numberOfFactors ( ) ; return match ; }
See if this ConditionTerm matches the given ConditionTerm . This is an AND operation . All the factors in the ConditionTerm must match .