Adds a listener to the listener list in the supplied map. If no list exists, one will be
created and mapped to the supplied key.
496563
public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
    {
        ListenerList<L> list = map.get(key);
        if (list == null) {
            map.put(key, list = new ListenerList<L>());
        }
        list.add(listener);
    }
627766
def register_listener(self, address, func):
        
        try:
            listeners = self.address_listeners[address]
        except KeyError:
            listeners = []
            self.address_listeners[address] = listeners

        if not func in listeners:
            listeners.append(func)

        return True
525885
public void addListener(WindowListener<K,R,P> listener) {
        this.listeners.addIfAbsent(new UnwrappedWeakReference<WindowListener<K,R,P>>(listener));
    }
947806
def add_listener(registry, listener):
    
    if listener is None or listener in registry:
        return False

    registry.append(listener)
    return True
1072100
public void addConnectionListener(KNXListener l)
	{
		if (l == null)
			return;
		synchronized (listeners) {
			if (!listeners.contains(l)) {
				listeners.add(l);
				listenersCopy = new ArrayList(listeners);
			}
			else
				logger.warn("event listener already registered");
		}
	}
1004751
synchronized void addListener(final AbstractEventListener<?> listener) {
        if (null == listener) {
            throw new NullPointerException();
        }

        final String eventType = listener.getEventType();
        if (null == eventType) {
            throw new NullPointerException();
        }

        List<AbstractEventListener<?>> listenerList = listeners.get(eventType);
        if (null == listenerList) {
            listenerList = new ArrayList<>();
            listeners.put(eventType, listenerList);
        }

        listenerList.add(listener);
    }
1318849
function () {
            var map = this._getAdditionalListenersList();
            for (var i = 0; i < map.length; i++) {
                this._addListener(map[i].evt, map[i].cb);
            }
        }
836496
public void addListener(ILabelProviderListener listener)
	{
		if (fLabelDecorators != null)
		{
			for (int i = 0; i < fLabelDecorators.size(); i++)
			{
				ILabelDecorator decorator = (ILabelDecorator) fLabelDecorators.get(i);
				decorator.addListener(listener);
			}
		}
		fListeners.add(listener);
	}
6975
public void registerListener(ResponseListener listener) {
		if (! listeners.contains(listener)) {
			boolean unique = true;
			
			for (ResponseListener existing : listeners) {
				if (existing.getClass().equals(listener.getClass())) {
					unique = false;
					break;
				}
			}
			
			if (unique) {
				listeners.add(listener);
			}
		}
	}
1110021
private void add(TreeMap<String, Object> map, String key, Object value) {
		// ZAP: Added the type argument.
	    Vector<Object> v = getList(map, key);
	    if (v == null) {
	    	// ZAP: Added the type argument.
	        v = new Vector<>();
	        synchronized (map) {
	            map.put(key, v);
	        }
	    }
	    if (!v.contains(value)) {
	        v.add(value);
	    }

	}
1182419
public synchronized void addListener(CollectionProxyListener listener)
    {
        if (_listeners == null)
        {
            _listeners = new ArrayList();
        }
        // to avoid multi-add of same listener, do check
        if(!_listeners.contains(listener))
        {
            _listeners.add(listener);
        }
    }
155156
public void add(Object key, Object value) {
        Object existing = mMap.get(key);
        if (existing instanceof List) {
            if (value instanceof List) {
                ((List)existing).addAll((List)value);
            }
            else {
                ((List)existing).add(value);
            }
        }
        else if (existing == null && !mMap.containsKey(key)) {
            if (value instanceof List) {
                mMap.put(key, new ArrayList((List)value));
            }
            else {
                mMap.put(key, value);
            }
        }
        else {
            List list = new ArrayList();
            list.add(existing);
            if (value instanceof List) {
                list.addAll((List)value);
            }
            else {
                list.add(value);
            }
            mMap.put(key, list);
        }
    }
944425
public final void addLayerListener(MapLayerListener listener) {
		if (this.listeners == null) {
			this.listeners = new ListenerCollection<>();
		}
		this.listeners.add(MapLayerListener.class, listener);
	}
1070734
public synchronized void addWeakListener(L listener) {
    Preconditions.checkNotNull(listener);

    _log.info("Adding a weak listener " + listener);
    _autoListeners.put(listener, null);
  }
558265
public void addListener(ILabelProviderListener listener)
	{
		if (fListeners == null)
		{
			fListeners = new ListenerList();
		}
		fListeners.add(listener);
		if (fProblemChangedListener == null)
		{
			fProblemChangedListener = new IProblemChangedListener() {
				public void problemsChanged(IResource[] changedResources,
						boolean isMarkerChange)
				{
					fireProblemsChanged(changedResources, isMarkerChange);
				}
			};
			VdmUIPlugin.getDefault()
					.getProblemMarkerManager()
					.addListener(fProblemChangedListener);
		}
	}
877063
public void addDataStoreListener(DataStoreListener l) {
    for(int i = 0; i < listenerList.size(); i++) {
      if(listenerList.get(i) == l) {
        return;
      }
    }
    listenerList.add(l);
  }
912853
public void addListenScope( Object scopeKey )
    {
        assert scopeKey != null;

        if ( _listenScopes == null )
        {
            _listenScopes = new ArrayList();
        }

        _listenScopes.add( scopeKey );
    }