aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/utils/LeastRecentlyUsedSet.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/utils/LeastRecentlyUsedSet.java b/main/src/cgeo/geocaching/utils/LeastRecentlyUsedSet.java
index 98aba03..b654fd6 100644
--- a/main/src/cgeo/geocaching/utils/LeastRecentlyUsedSet.java
+++ b/main/src/cgeo/geocaching/utils/LeastRecentlyUsedSet.java
@@ -2,6 +2,7 @@ package cgeo.geocaching.utils;
import java.util.AbstractSet;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -102,6 +103,18 @@ public class LeastRecentlyUsedSet<E> extends AbstractSet<E>
}
/**
+ * Synchronized removal of all elements contained in another collection.
+ */
+ @Override
+ public synchronized boolean removeAll(final Collection<?> c) {
+ boolean changed = false;
+ for (final Object o: c) {
+ changed |= remove(o);
+ }
+ return changed;
+ }
+
+ /**
* Synchronized clearing of the set
* Copy of the HashSet code if clear()
*