//============================================================================== // DocumentFilterI.java //============================================================================== package tribble.search; // System imports import java.lang.String; // Local imports // (None) /******************************************************************************* * 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 {@link 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 {@link java.io.FilenameFilter}
* interface.
*
* @version $Revision: 1.3 $ $Date: 2001/06/18 03:07:13 $
* @since 2001-05-18
* @author
* David R. Tribble
* (david@tribble.com).
*
* Copyright
* ©2001 by David R. Tribble, all rights reserved.
*
* @see DocumentSearcherI
* @see DocumentI
*/
public interface DocumentFilterI
{
// Identification
/** Revision information. */
static final String REV =
"@(#)tribble/search/DocumentFilterI.java $Revision: 1.3 $ $Date: 2001/06/18 03:07:13 $\n";
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Public constants
/** Series number. */
public static final int SERIES = 200;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Public methods
/***************************************************************************
* Accept or reject a document entry.
*
* @param doc
* A document entry.
*
* @return
* True if document entry doc is to be accepted, otherwise false if
* it is to be rejected.
*
* @throws Exception
* Thrown if the selection criteria are malformed, or if some other error
* occurs.
*
* @since 1.2, 2001-06-15
*
* @see DocumentSearcherI#find
*/
public boolean accept(DocumentI doc)
throws Exception;
}
// End DocumentFilterI.java