Author: tfmorris
Date: 2007-10-03 21:59:58-0700
New Revision: 13637
Modified:
trunk/src_new/org/argouml/notation/NotationProvider.java
Log:
Add types and more Javadoc for listeners collection
Modified: trunk/src_new/org/argouml/notation/NotationProvider.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/notation/NotationProvider.java?view=diff&rev=13637&p1=trunk/src_new/org/argouml/notation/NotationProvider.java&p2=trunk/src_new/org/argouml/notation/NotationProvider.java&r1=13636&r2=13637
==============================================================================
--- trunk/src_new/org/argouml/notation/NotationProvider.java (original)
+++ trunk/src_new/org/argouml/notation/NotationProvider.java 2007-10-03 21:59:58-0700
@@ -29,9 +29,9 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.Iterator;
import org.apache.log4j.Logger;
+
import org.argouml.model.Model;
/**
@@ -54,10 +54,12 @@
Logger.getLogger(NotationProvider.class);
/**
- * A collection of listeners registered for this notation.
- * This facilitates easy removal of a complex set of listeners.
+ * A collection of properties of listeners registered for this notation.
+ * Each entry is a 2 element array containing the element and the property
+ * name(s) for which a listener is registered. This facilitates easy removal
+ * of a complex set of listeners.
*/
- private Collection listeners = new ArrayList();
+ private Collection<Object[]> listeners = new ArrayList<Object[]>();
/**
* @return a i18 key that represents a help string
@@ -76,7 +78,9 @@
* @return true if the value for the key is true, otherwise false
*/
public static boolean isValue(String key, HashMap map) {
- if (map == null) return false;
+ if (map == null) {
+ return false;
+ }
Object o = map.get(key);
if (!(o instanceof Boolean)) {
return false;
@@ -259,8 +263,7 @@
*/
protected final void removeAllElementListeners(
PropertyChangeListener listener) {
- for (Iterator iter = listeners.iterator(); iter.hasNext();) {
- Object[] lis = (Object[]) iter.next();
+ for (Object[] lis : listeners) {
Object property = lis[1];
if (property == null) {
Model.getPump().removeModelEventListener(listener, lis[0]);
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.