//============================================================================== // AbstractDocumentFilter.java //============================================================================== package tribble.search; // System imports import java.lang.String; // Local imports import tribble.search.DocumentFilterI; /******************************************************************************* * Generic document filter. * *

* This base class is a generic search filter that is contructed from a criteria * string. By default, the {@link #accept accept()} method always returns true, * so it should be overridden in classes that extend this base class, so as to do * something meaningful with the search criteria. * * * @version $Revision: 1.1 $ $Date: 2001/06/19 23:14:26 $ * @since 2001-06-19 * @author * David R. Tribble * (david@tribble.com). *
* Copyright * ©2001 by David R. Tribble, all rights reserved.
* * @see DocumentFilterI */ public abstract class AbstractDocumentFilter implements DocumentFilterI { // Identification /** Revision information. */ static final String REV = "@(#)tribble/search/AbstractDocumentFilter.java $Revision: 1.1 $ $Date: 2001/06/19 23:14:26 $\n"; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Public constants /** Series number. */ public static final int SERIES = 100; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Public constructors /*************************************************************************** * Constructor. * * @param crit * Search criteria. The format and meaning of this string should be defined * in classes that extend this base class. * * @since 1.1, 2001-06-19 */ public AbstractDocumentFilter(String crit) { // Initialize m_criteria = crit; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Public methods /*************************************************************************** * Accept or reject a document entry. * *

* This method should be overridden in classes that extend this base class, * so as to do something meaningful with the search criteria. * * @param doc * A document entry. * * @return * True, always. * * @throws Exception * Thrown if the selection criteria are malformed, or if some other error * occurs. * * @see DocumentSearcherI#find * * @since 1.1, 2001-06-19 */ public boolean accept(DocumentI doc) throws Exception //implements tribble.search.DocumentFilterI { // Always succeed return (true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Protected constructors /*************************************************************************** * Default constructor. * * @since 1.1, 2001-06-19 */ protected AbstractDocumentFilter() { // Do nothing } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Protected variables /** Search criteria. */ protected String m_criteria; } // End AbstractDocumentFilter.java