{@inheritDoc}
(Collection c)
| 345 | |
| 346 | /** {@inheritDoc} */ |
| 347 | @Override |
| 348 | public boolean removeAll(Collection c) { |
| 349 | if (c == null) { |
| 350 | return false; |
| 351 | } |
| 352 | |
| 353 | List values = new ArrayList(); |
| 354 | // GROOVY-7783 use Sets for O(1) performance for contains |
| 355 | Set delegateSet = new HashSet<Object>(delegate); |
| 356 | if (!(c instanceof Set)) { |
| 357 | c = new HashSet<Object>(c); |
| 358 | } |
| 359 | for (Object element : c) { |
| 360 | if (delegateSet.contains(element)) { |
| 361 | values.add(element); |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | int oldSize = size(); |
| 366 | boolean success = delegate.removeAll(c); |
| 367 | if (success && !values.isEmpty()) { |
| 368 | fireMultiElementRemovedEvent(values); |
| 369 | fireSizeChangedEvent(oldSize, size()); |
| 370 | } |
| 371 | |
| 372 | return success; |
| 373 | } |
| 374 | |
| 375 | /** {@inheritDoc} */ |
| 376 | @Override |
nothing calls this directly
no test coverage detected