Code example for Collection

Methods: clear

0
 
        public void clear() { 
            lock.lock();
            try { 
                final M map = copy();
                map.values().clear();
                set(map);
            } finally { 
                lock.unlock();
            } 
        } 
 
        public boolean remove(final Object o) {
            lock.lock();
            try { 
                if (!contains(o)) {
                    return false; 
                } 
                final M map = copy();
                try { 
                    return map.values().remove(o);