Code example for CopyOnWriteArrayList

Methods: remove

0
    public <T extends ConfigObjectType<T, C>, C extends ConfiguredObject<T, C>> void removeConfigEventListener(T type, ConfigEventListener<T,C> listener)
    { 
        CopyOnWriteArrayList listeners = _listenerMap.get(type);
        if(listeners != null)
        { 
            listeners.remove(listener);
        } 
    } 
 
    private void sendEvent(Event e, ConfiguredObject o)
    { 
        CopyOnWriteArrayList<ConfigEventListener> listeners = _listenerMap.get(o.getConfigType());
        if(listeners != null)
        { 
            for(ConfigEventListener listener : listeners)
            { 
                listener.onEvent(o, e);
            } 
        } 
    } 
Experience pair programming with AI  Get Codota for Java