org.oreodata.predicates
Class CompoundPredicate

java.lang.Object
  |
  +--org.oreodata.predicates.Predicate
        |
        +--org.oreodata.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 org.oreodata.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
See Also:
Constant Field Values

INTERSECTION

public static final int INTERSECTION
See Also:
Constant Field Values
Constructor Detail

CompoundPredicate

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

sqlEquivalent

public java.lang.String sqlEquivalent()
Specified by:
sqlEquivalent in interface RecordFilter
Specified by:
sqlEquivalent in class Predicate
Returns:
The SQL SELECT command that is the equivalent to this. A null value would indicate that we don't know the SQL command. In that case, the filter will have to be applied in-memory.

accept

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

Specified by:
accept in interface RecordFilter
Specified by:
accept in class Predicate

getComplement

public Predicate getComplement()
Specified by:
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.

Specified by:
recType in interface RecordFilter
Specified by:
recType in class Predicate