com.niggle.data
Interface RecordFilter

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
RecordFilter.NullFilter, RecordFilter.ClassConstraint, RecordFilter.FieldConstraint, RecordFilter.TypeConstraint, RecordFilter.UnionFilter, RecordFilter.IntersectionFilter, RecordFilter.NegationFilter

public interface RecordFilter
extends java.io.Serializable

An interface for objects that can filter a set of records based on some criterion. A unary predicate that operates on records, more formally.

Author:
Jonathan Revusky

Inner Class Summary
static class RecordFilter.ClassConstraint
           
static class RecordFilter.FieldConstraint
           
static class RecordFilter.IntersectionFilter
           
static class RecordFilter.NegationFilter
           
static class RecordFilter.NullFilter
           
static class RecordFilter.TypeConstraint
           
static class RecordFilter.UnionFilter
           
 
Field Summary
static RecordFilter NULL_FILTER
           
 
Method Summary
 boolean accept(Record rec)
          The method that determines whether the record gets through the filter.
 java.lang.String sqlEquivalent()
          Method that returns the SQL WHERE clause that is the equivalent of the unary predicate that this field represents.
 

Field Detail

NULL_FILTER

public static final RecordFilter NULL_FILTER
Method Detail

accept

public boolean accept(Record rec)
The method that determines whether the record gets through the filter.

sqlEquivalent

public java.lang.String sqlEquivalent()
Method that returns the SQL WHERE clause that is the equivalent of the unary predicate that this field represents. It is the programmer's responsibility that this really be equivalent. For programmer convenience, the string returned should start with a space and then WHERE