Rule.java
上传用户:qing5858
上传日期:2015-10-27
资源大小:6056k
文件大小:1k
源码类别:

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.spi;
  2. import net.javacoding.jspider.api.model.Decision;
  3. import net.javacoding.jspider.api.model.Site;
  4. import net.javacoding.jspider.core.SpiderContext;
  5. import java.net.URL;
  6. /**
  7.  * Interface to be implemented upon each class that will act as a Decision-
  8.  * taking class.
  9.  * A group of Rule objects will together decide whether a certain URL is
  10.  * eligible for spidering and/or parsing in a given context.
  11.  *
  12.  * $Id: Rule.java,v 1.1 2003/04/03 16:25:22 vanrogu Exp $
  13.  *
  14.  * @author G黱ther Van Roey
  15.  */
  16. public interface Rule {
  17.     /**
  18.      * Returns the name of the rule.
  19.      * @return the name of the rule
  20.      */
  21.     public String getName ( );
  22.     /**
  23.      * Applies the rule to the given URL.
  24.      * @param context the context we're spidering in
  25.      * @param currentSite the site we're currently spidering
  26.      * @param url the URL to be evaluated
  27.      * @return Decision object telling whether the URL is accepted for a
  28.      * specific purpose.
  29.      */
  30.     public Decision apply(SpiderContext context, Site currentSite, URL url);
  31. }