home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Java / Java.zip / jload18.zip / request.java < prev    next >
Text File  |  1999-12-02  |  1KB  |  67 lines

  1. public final class request implements Cloneable
  2. {
  3.  public String url;
  4.  public location loc;
  5.  public short depth;
  6.  public boolean depthset;
  7.  
  8.  public byte act,update,size;
  9.  public short log;
  10.  public int sizelimit,updatelimit; // -1 is no limit
  11.  
  12.  public byte retry;
  13.  
  14.  request(String url,location loc)
  15.  {
  16.   retry=0;
  17.   this.url=url;
  18.   this.loc=loc;
  19.   depthset=false;
  20.   depth=loc.depth;
  21.   act=update=size=0;
  22.   sizelimit=mask.SIZE_NOLIMIT;
  23.   updatelimit=mask.UPD_NOLIMIT;
  24.   log=loc.defaultmask.log;
  25.  }
  26.  
  27.  request(String url,location loc,mask m,short rdepth,boolean rdepthset)
  28.  {
  29.   retry=0;
  30.   this.url=url;
  31.   this.loc=loc;
  32.   depthset=rdepthset;
  33.   
  34.   act=m.action;
  35.   log=m.log;
  36.   update=m.update;
  37.   size=m.size;
  38.   sizelimit=m.sizelimit;
  39.   updatelimit=m.updatelimit;
  40.   if(m.depth!=mask.DEPTH_NOCHANGE)
  41.     if (rdepthset==false)
  42.       { depth=m.depth;depthset=true;}
  43.     else
  44.       depth=(short)Math.min(m.depth,rdepth);
  45.   else
  46.    depth=rdepth;
  47.  }
  48.  
  49.  public final boolean equals(Object o)
  50.  {
  51.   if(o instanceof request)
  52.    return url.equals(((request)o).url);
  53.   else
  54.    return false;
  55.  }
  56.  
  57.  public final int hashCode()
  58.  {
  59.   return url.hashCode();
  60.  }
  61.  
  62.  public final Object clone () throws CloneNotSupportedException
  63.  {
  64.   return super.clone();
  65.  }
  66. }
  67.