Code example for CopyOnWriteArrayList

Methods: add

0
    public <T extends ConfigObjectType<T, C>, C extends ConfiguredObject<T, C>> void addConfigEventListener(T type, ConfigEventListener<T,C> listener)
    { 
        CopyOnWriteArrayList listeners = _listenerMap.get(type);
        if(listeners == null)
        { 
            listeners = new CopyOnWriteArrayList();
            CopyOnWriteArrayList oldListeners = _listenerMap.putIfAbsent(type, listeners);
            if(oldListeners != null)
            { 
                listeners = oldListeners;
            } 
 
        } 
 
        listeners.add(listener);
 
    } 
 
    public <T extends ConfigObjectType<T, C>, C extends ConfiguredObject<T, C>> void removeConfigEventListener(T type, ConfigEventListener<T,C> listener)
    { 
Contextual code suggestions in your IDE  Get Codota for Java