2458 |
|
else |
2459 |
|
return (Spliterator<E>)((SubMap<?,E>)m).valueIterator(); |
2460 |
|
} |
2461 |
+ |
public boolean removeIf(Predicate<? super E> filter) { |
2462 |
+ |
return ((ConcurrentSkipListMap<?,E>)m).removeValueIf(filter); |
2463 |
+ |
} |
2464 |
|
} |
2465 |
|
|
2466 |
|
static final class EntrySet<K1,V1> extends AbstractSet<Map.Entry<K1,V1>> { |
3253 |
|
removed = true; |
3254 |
|
} |
3255 |
|
} |
3256 |
+ |
return removed; |
3257 |
+ |
} |
3258 |
+ |
|
3259 |
+ |
/** |
3260 |
+ |
* Helper method for Values.removeIf |
3261 |
+ |
*/ |
3262 |
+ |
boolean removeValueIf(Predicate<? super V> function) { |
3263 |
+ |
if (function == null) throw new NullPointerException(); |
3264 |
+ |
boolean removed = false; |
3265 |
+ |
for (Node<K,V> n = findFirst(); n != null; n = n.next) { |
3266 |
+ |
V v; |
3267 |
+ |
if ((v = n.getValidValue()) != null) { |
3268 |
+ |
K k = n.key; |
3269 |
+ |
if (function.test(v) && remove(k, v)) |
3270 |
+ |
removed = true; |
3271 |
+ |
} |
3272 |
+ |
} |
3273 |
|
return removed; |
3274 |
|
} |
3275 |
|
|