00001 final class Connector 00002 { 00003 int queue; 00004 00005 public Connector() 00006 { 00007 this.queue = 1; 00008 } 00009 00010 public final synchronized void add (int o) 00011 { 00012 this.queue = o; 00013 this.notifyAll(); 00014 } 00015 00016 public final synchronized void stop () 00017 { 00018 this.queue = 0; 00019 this.notifyAll(); 00020 } 00021 00022 public final synchronized int take () 00023 { 00024 int value; 00025 while (edu.ksu.cis.bandera.abstraction.lib.integral.Signs.lt(this.queue,0)) 00026 { 00027 try { 00028 this.wait(); 00029 } 00030 catch (java.lang.InterruptedException ex) { 00031 } 00032 } 00033 value = this.queue; 00034 return value; 00035 } 00036 }