org.oreodata.predicates
Class SimplePredicate
java.lang.Object
|
+--org.oreodata.predicates.Predicate
|
+--org.oreodata.predicates.SimplePredicate
- All Implemented Interfaces:
- RecordFilter, java.io.Serializable
- public class SimplePredicate
- extends Predicate
A Predicate that represents a simple comparison filter.
- Author:
- Jonathan Revusky
- See Also:
- Serialized Form
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IS_NULL
public static final int IS_NULL
- See Also:
- Constant Field Values
EQUALS
public static final int EQUALS
- See Also:
- Constant Field Values
GREATER_THAN
public static final int GREATER_THAN
- See Also:
- Constant Field Values
LESS_THAN
public static final int LESS_THAN
- See Also:
- Constant Field Values
LIKE
public static final int LIKE
- See Also:
- Constant Field Values
NOT_NULL
public static final int NOT_NULL
- See Also:
- Constant Field Values
NOT_EQUALS
public static final int NOT_EQUALS
- See Also:
- Constant Field Values
LESS_THAN_EQUALS
public static final int LESS_THAN_EQUALS
- See Also:
- Constant Field Values
GREATER_THAN_EQUALS
public static final int GREATER_THAN_EQUALS
- See Also:
- Constant Field Values
NOT_LIKE
public static final int NOT_LIKE
- See Also:
- Constant Field Values
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)
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