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

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.api.event.resource;
  2. import net.javacoding.jspider.api.event.EventVisitor;
  3. import net.javacoding.jspider.api.event.JSpiderEvent;
  4. import net.javacoding.jspider.api.model.Resource;
  5. import java.net.URL;
  6. /**
  7.  *
  8.  * $Id: ResourceRelatedEvent.java,v 1.3 2003/04/07 15:50:46 vanrogu Exp $
  9.  *
  10.  * @author G黱ther Van Roey
  11.  */
  12. public abstract class ResourceRelatedEvent extends JSpiderEvent {
  13.     protected Resource resource;
  14.     public ResourceRelatedEvent(Resource resource) {
  15.         this.resource = resource;
  16.     }
  17.     public URL getURL() {
  18.         return resource.getURL();
  19.     }
  20.     public void accept(EventVisitor visitor) {
  21.         visitor.visit(this);
  22.     }
  23.     public String toString() {
  24.         return super.toString() + " " + getComment();
  25.     }
  26. }