com.revusky.oreo
Interface RecordFilter
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- TypeFilter, Predicate, ClassConstraint
- public interface RecordFilter
- extends java.io.Serializable
An interface for objects that can filter a set of records
based on some criterion. More formally speaking: a unary predicate
that operates on collections of records.
A RecordFilter has a method called accept() that allows
us to filter over a set of in-memory records. The
sqlEquivalent() should return the SQL query
that would provide the same subset of records from an
RDBMS with an SQL interface. It is the responsibility
of the implementor of a subclass that the SQL statement
actually is equivalent to the accept() method. If not,
all kinds of bugs and mayhem may result!
- Author:
- Jonathan Revusky
- See Also:
- com.revusky.oreo.predicates
Method Summary |
boolean |
accept(Record rec)
Does this record meet the filter criterion? |
java.lang.String |
recType()
says what kind of record type we are looking for, i.e. |
java.lang.String |
sqlEquivalent()
|
accept
public boolean accept(Record rec)
- Does this record meet the filter criterion?
recType
public java.lang.String recType()
- 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.
sqlEquivalent
public java.lang.String sqlEquivalent()
- Returns:
- The SQL SELECT command that is the equivalent to this. A null
value would indicate that we don't know the SQL command.