com.revusky.oreo.predicates
Class SimplePredicate

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

public class SimplePredicate
extends Predicate

A Predicate that represents a simple comparison filter.

See Also:
Serialized Form

Field Summary
static int EQUALS
           
static int GREATER_THAN
           
static int GREATER_THAN_EQUALS
           
static int IS_NULL
           
static int LESS_THAN
           
static int LESS_THAN_EQUALS
           
static int LIKE
           
static int NOT_EQUALS
           
static int NOT_LIKE
           
static int NOT_NULL
           
 
Fields inherited from class com.revusky.oreo.predicates.Predicate
complement
 
Constructor Summary
protected SimplePredicate(int comparisonType, java.lang.String recType, java.lang.String fieldName, java.lang.Object comparisonValue, java.util.Comparator comparator)
           
protected SimplePredicate(int comparisonType, java.lang.String recType, java.lang.String fieldName, java.lang.Object comparisonValue, java.util.Comparator comparator, boolean caseInsensitive)
           
 
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

IS_NULL

public static final int IS_NULL

EQUALS

public static final int EQUALS

GREATER_THAN

public static final int GREATER_THAN

LESS_THAN

public static final int LESS_THAN

LIKE

public static final int LIKE

NOT_NULL

public static final int NOT_NULL

NOT_EQUALS

public static final int NOT_EQUALS

LESS_THAN_EQUALS

public static final int LESS_THAN_EQUALS

GREATER_THAN_EQUALS

public static final int GREATER_THAN_EQUALS

NOT_LIKE

public static final int NOT_LIKE
Constructor Detail

SimplePredicate

protected SimplePredicate(int comparisonType,
                          java.lang.String recType,
                          java.lang.String fieldName,
                          java.lang.Object comparisonValue,
                          java.util.Comparator comparator,
                          boolean caseInsensitive)

SimplePredicate

protected SimplePredicate(int comparisonType,
                          java.lang.String recType,
                          java.lang.String fieldName,
                          java.lang.Object comparisonValue,
                          java.util.Comparator comparator)
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.