home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Java / netscape / application / Event.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-12  |  1.8 KB  |  72 lines

  1. package netscape.application;
  2.  
  3. import netscape.util.InconsistencyException;
  4.  
  5. public class Event implements Cloneable {
  6.    EventProcessor processor;
  7.    Object synchronousLock;
  8.    long timeStamp;
  9.    int type;
  10.  
  11.    public Event() {
  12.       this(System.currentTimeMillis());
  13.    }
  14.  
  15.    public Event(long var1) {
  16.       this.timeStamp = var1;
  17.    }
  18.  
  19.    public void setType(int var1) {
  20.       this.type = var1;
  21.    }
  22.  
  23.    public int type() {
  24.       return this.type;
  25.    }
  26.  
  27.    public void setTimeStamp(long var1) {
  28.       this.timeStamp = var1;
  29.    }
  30.  
  31.    public long timeStamp() {
  32.       return this.timeStamp;
  33.    }
  34.  
  35.    public void setProcessor(EventProcessor var1) {
  36.       this.processor = var1;
  37.    }
  38.  
  39.    public EventProcessor processor() {
  40.       return this.processor;
  41.    }
  42.  
  43.    public Object clone() {
  44.       try {
  45.          return super.clone();
  46.       } catch (CloneNotSupportedException var2) {
  47.          throw new InconsistencyException(this + ": clone() not supported :" + var2);
  48.       }
  49.    }
  50.  
  51.    synchronized Object synchronousLock() {
  52.       return this.synchronousLock;
  53.    }
  54.  
  55.    synchronized Object createSynchronousLock() {
  56.       if (this.synchronousLock != null) {
  57.          throw new InconsistencyException("Can't create synchronous lock if one is already set");
  58.       } else {
  59.          this.synchronousLock = new Object();
  60.          return this.synchronousLock;
  61.       }
  62.    }
  63.  
  64.    synchronized void clearSynchronousLock() {
  65.       if (this.synchronousLock == null) {
  66.          throw new InconsistencyException("Can't clear synchronous lock if one isn't set");
  67.       } else {
  68.          this.synchronousLock = null;
  69.       }
  70.    }
  71. }
  72.