List of usage examples for org.apache.commons.collections15.keyvalue DefaultMapEntry DefaultMapEntry
public DefaultMapEntry(final Map.Entry<K, V> entry)
From source file:de.dhke.projects.cutil.collections.aspect.AspectMapEntrySet.java
private boolean batchRemove(final Collection<?> c, final boolean retain) { for (Map.Entry<K, V> entry : this) { if (c.contains(entry) != retain) { CollectionItemEvent<Map.Entry<K, V>, Map<K, V>> ev = new CollectionItemEvent<Entry<K, V>, Map<K, V>>( this, _aspectMap, new DefaultMapEntry<>(entry)); _aspectMap.notifyBeforeElementRemoved(ev); }//from ww w .ja v a 2 s . c om } boolean wasRemoved = false; Iterator<Map.Entry<K, V>> iter = _entrySet.iterator(); while (iter.hasNext()) { Map.Entry<K, V> entry = iter.next(); if (c.contains(entry) != retain) { CollectionItemEvent<Map.Entry<K, V>, Map<K, V>> ev = new CollectionItemEvent<Entry<K, V>, Map<K, V>>( this, _aspectMap, new DefaultMapEntry<>(entry)); iter.remove(); _aspectMap.notifyAfterElementRemoved(ev); wasRemoved = true; } } return wasRemoved; }