com.revusky.oreo.predicates
Class CompoundPredicate

java.lang.Object
  |
  +--com.revusky.oreo.predicates.Predicate
        |
        +--com.revusky.oreo.predicates.CompoundPredicate
All Implemented Interfaces:
RecordFilter, java.io.Serializable

public class CompoundPredicate
extends Predicate

A Predicate that represents the AND, OR or XOR condition on two other predicates.

See Also:
Serialized Form

Field Summary
static int INTERSECTION
           
static int UNION
           
 
Fields inherited from class com.revusky.oreo.predicates.Predicate
complement
 
Constructor Summary
protected CompoundPredicate(int operation, Predicate lhs, Predicate rhs)
           
 
Method Summary
 boolean accept(Record rec)
          Does this record meet the filter criterion?
 Predicate getComplement()
           
 java.lang.String recType()
          says what kind of record type we are looking for, i.e.
 java.lang.String sqlEquivalent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNION

public static final int UNION

INTERSECTION

public static final int INTERSECTION
Constructor Detail

CompoundPredicate

protected CompoundPredicate(int operation,
                            Predicate lhs,
                            Predicate rhs)
Method Detail

sqlEquivalent

public java.lang.String sqlEquivalent()
Following copied from interface: com.revusky.oreo.RecordFilter
Returns:
The SQL SELECT command that is the equivalent to this. A null value would indicate that we don't know the SQL command.

accept

public boolean accept(Record rec)
Description copied from interface: RecordFilter
Does this record meet the filter criterion?

getComplement

public Predicate getComplement()
Overrides:
getComplement in class Predicate

recType

public java.lang.String recType()
Description copied from interface: RecordFilter
says what kind of record type we are looking for, i.e. the filter will only return results of a certain record type. If this returns null, it means that we could have heterogeneous results.