[COLLECTIONS-534] Added clarifiying comment about performance to CollectionBag.retainAll. Thanks to Oswaldo Olivo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1632904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab82b11dde
commit
ad28a3cb5c
|
@ -22,8 +22,11 @@
|
|||
<body>
|
||||
|
||||
<release version="4.1" date="TBD" description="">
|
||||
<action issue="COLLECTIONS-534" dev="tn" type="fix" due-to="Oswaldo Olivo">
|
||||
Added clarifying javadoc wrt runtime complexity of "CollectionBag#retainAll".
|
||||
</action>
|
||||
<action issue="COLLECTIONS-535" dev="britter" type="update" due-to="Alexander Kjäll">
|
||||
Clarify JavaDoc of MultiKey getKey() and size()
|
||||
Clarify JavaDoc of MultiKey getKey() and size().
|
||||
</action>
|
||||
<action issue="COLLECTIONS-529" dev="tn" type="add" due-to="Alexander Muthmann, Dipanjan Laha">
|
||||
Added methods "removeAll(...)" and "retainAll(...)" to "CollectionUtils" that perform
|
||||
|
|
|
@ -186,11 +186,17 @@ public final class CollectionBag<E> extends AbstractBagDecorator<E> {
|
|||
|
||||
/**
|
||||
* <i>(Change)</i>
|
||||
* Remove any members of the bag that are not in the given
|
||||
* collection, <i>not</i> respecting cardinality. That is, any object
|
||||
* in the given collection <code>coll</code> will be retained in the
|
||||
* bag with the same number of copies prior to this operation. All
|
||||
* other objects will be completely removed from this bag.
|
||||
* Remove any members of the bag that are not in the given collection,
|
||||
* <i>not</i> respecting cardinality. That is, any object in the given
|
||||
* collection <code>coll</code> will be retained in the bag with the same
|
||||
* number of copies prior to this operation. All other objects will be
|
||||
* completely removed from this bag.
|
||||
* <p>
|
||||
* This implementation iterates over the elements of this bag, checking
|
||||
* each element in turn to see if it's contained in <code>coll</code>.
|
||||
* If it's not contained, it's removed from this bag. As a consequence,
|
||||
* it is advised to use a collection type for <code>coll</code> that provides
|
||||
* a fast (e.g. O(1)) implementation of {@link Collection#contains(Object)}.
|
||||
*
|
||||
* @param coll the collection to retain
|
||||
* @return <code>true</code> if this call changed the collection
|
||||
|
|
Loading…
Reference in New Issue