/[storm]/storm/org/nongnu/storm/impl/AsyncSetCollector.java
ViewVC logotype

Diff of /storm/org/nongnu/storm/impl/AsyncSetCollector.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by benja, Mon Apr 21 18:15:43 2003 UTC revision 1.5 by benja, Mon Apr 21 21:07:41 2003 UTC
# Line 54  public class AsyncSetCollector implement Line 54  public class AsyncSetCollector implement
54          this.state = 0;          this.state = 0;
55      }      }
56    
57      protected void receive(Object o) {      public void receive(Object o) {
58          if(state != 0)          if(state != 0)
59              throw new IllegalStateException("Cannot receive more elements");              throw new IllegalStateException("Cannot receive more elements");
60                    
# Line 67  public class AsyncSetCollector implement Line 67  public class AsyncSetCollector implement
67          }          }
68      }      }
69    
70      protected synchronized void finish(boolean timeout) {      public synchronized void finish(boolean timeout) {
71          state = timeout ? -1 : 1;          state = timeout ? -1 : 1;
72    
73            for(Iterator i=listeners.iterator(); i.hasNext();) {
74                CollectionListener l = (CollectionListener)i.next();
75                l.finish(timeout);
76            }
77          notifyAll();          notifyAll();
78      }      }
79    
# Line 140  public class AsyncSetCollector implement Line 145  public class AsyncSetCollector implement
145                      queue.notifyAll();                      queue.notifyAll();
146                      return true;                      return true;
147                  }                  }
148                    public void finish(boolean timeout) {
149                    }
150              });              });
151          return new Iterator() {          return new Iterator() {
152                  public boolean hasNext() {                  public boolean hasNext() {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26