tribble.search
Interface DocumentFilterI

All Known Implementing Classes:
AbstractDocumentFilter, DocumentQueryFilter, FFilter

public interface DocumentFilterI

Generic document entry filter.

Implementations of this interface are used to selectively filter document entries as they are being searched for by document searchers. (Document searchers are implementations of the DocumentSearcherI interface.)

It is recommended that classes that implement this interface provide two kinds of constructors:

    class MyFilter
        implements tribble.search.DocumentFilterI
    {
        // Default constructor
        public MyFilter()
        { ... }

        // Constructor
        public MyFilter(String pred)
        { ... }

        ...
    } 

The second constructor takes an argument, pred, which is a string containing some sort of conditional expression (e.g., like an SQL SELECT statement) that specifies the filtering criteria.

This interface was modelled after the FilenameFilter interface.

Since:
2001-05-18
Version:
$Revision: 1.3 $ $Date: 2001/06/18 03:07:13 $
Author:
David R. Tribble (david@tribble.com).
Copyright ©2001 by David R. Tribble, all rights reserved.
See Also:
DocumentSearcherI, DocumentI

Field Summary
static java.lang.String REV
          Revision information.
static int SERIES
          Series number.
 
Method Summary
 boolean accept(DocumentI doc)
          Accept or reject a document entry.
 

Field Detail

REV

public static final java.lang.String REV
Revision information.

See Also:
Constant Field Values

SERIES

public static final int SERIES
Series number.

See Also:
Constant Field Values
Method Detail

accept

public boolean accept(DocumentI doc)
               throws java.lang.Exception
Accept or reject a document entry.

Parameters:
doc - A document entry.
Returns:
True if document entry doc is to be accepted, otherwise false if it is to be rejected.
Throws:
java.lang.Exception - Thrown if the selection criteria are malformed, or if some other error occurs.
Since:
1.2, 2001-06-15
See Also:
DocumentSearcherI.find(tribble.search.DocumentFilterI)