author | Jaroslav Tulach <jtulach@netbeans.org> |
Sun, 20 Mar 2011 18:52:47 +0100 | |
changeset 374 | 35da2d439e3d |
child 375 | 3abae898011d |
permissions | -rw-r--r-- |
jtulach@374 | 1 |
/* |
jtulach@374 | 2 |
* To change this template, choose Tools | Templates |
jtulach@374 | 3 |
* and open the template in the editor. |
jtulach@374 | 4 |
*/ |
jtulach@374 | 5 |
package org.apidesign.openfixed; |
jtulach@374 | 6 |
|
jtulach@374 | 7 |
import java.util.List; |
jtulach@374 | 8 |
import java.util.concurrent.CopyOnWriteArrayList; |
jtulach@374 | 9 |
|
jtulach@374 | 10 |
/** |
jtulach@374 | 11 |
* |
jtulach@374 | 12 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jtulach@374 | 13 |
*/ |
jtulach@374 | 14 |
final class TrivialEventSupport implements EventSupport { |
jtulach@374 | 15 |
List<ModificationListener> listener = new CopyOnWriteArrayList<ModificationListener>(); |
jtulach@374 | 16 |
|
jtulach@374 | 17 |
TrivialEventSupport() { |
jtulach@374 | 18 |
} |
jtulach@374 | 19 |
|
jtulach@374 | 20 |
@Override |
jtulach@374 | 21 |
public void fireModificationEvent(ModificationEvent ev) { |
jtulach@374 | 22 |
for (ModificationListener l : listener) { |
jtulach@374 | 23 |
l.modification(ev); |
jtulach@374 | 24 |
} |
jtulach@374 | 25 |
} |
jtulach@374 | 26 |
|
jtulach@374 | 27 |
@Override |
jtulach@374 | 28 |
public void add(ModificationListener l) { |
jtulach@374 | 29 |
listener.add(l); |
jtulach@374 | 30 |
} |
jtulach@374 | 31 |
|
jtulach@374 | 32 |
@Override |
jtulach@374 | 33 |
public void remove(ModificationListener l) { |
jtulach@374 | 34 |
listener.remove(l); |
jtulach@374 | 35 |
} |
jtulach@374 | 36 |
|
jtulach@374 | 37 |
} |