home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 April / PCpro_2007_04.ISO / files / dsl / jNetTool.exe / org / xbill / DNS / Cache$Element.class (.txt) < prev    next >
Encoding:
Java Class File  |  2005-06-05  |  819 b   |  23 lines

  1. package org.xbill.DNS;
  2.  
  3. abstract class Cache$Element implements TypedObject {
  4.    int credibility;
  5.    int expire;
  6.  
  7.    protected void setValues(int credibility, long ttl) {
  8.       this.credibility = credibility;
  9.       this.expire = (int)(System.currentTimeMillis() / 1000L + ttl);
  10.       if (this.expire < 0 || this.expire > Integer.MAX_VALUE) {
  11.          this.expire = Integer.MAX_VALUE;
  12.       }
  13.  
  14.    }
  15.  
  16.    public final boolean expired() {
  17.       int now = (int)(System.currentTimeMillis() / 1000L);
  18.       return now >= this.expire;
  19.    }
  20.  
  21.    public abstract int getType();
  22. }
  23.