58 |
if(state != 0) |
if(state != 0) |
59 |
throw new IllegalStateException("Cannot receive more elements"); |
throw new IllegalStateException("Cannot receive more elements"); |
60 |
|
|
61 |
set.add(o); |
synchronized(set) { |
62 |
|
set.add(o); |
63 |
|
} |
64 |
|
|
65 |
for(Iterator i=listeners.iterator(); i.hasNext();) { |
for(Iterator i=listeners.iterator(); i.hasNext();) { |
66 |
CollectionListener l = (CollectionListener)i.next(); |
CollectionListener l = (CollectionListener)i.next(); |
115 |
listeners.add(l); |
listeners.add(l); |
116 |
synchronized(set) { |
synchronized(set) { |
117 |
for(Iterator i=set.iterator(); i.hasNext();) { |
for(Iterator i=set.iterator(); i.hasNext();) { |
118 |
if(l.item(i.next())) return; |
if(!l.item(i.next())) return; |
119 |
} |
} |
120 |
} |
} |
121 |
} |
} |