[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:
Thomas Neidhart 2014-10-19 12:44:34 +00:00
parent ab82b11dde
commit ad28a3cb5c
2 changed files with 15 additions and 6 deletions

View File

@ -22,8 +22,11 @@
<body> <body>
<release version="4.1" date="TBD" description=""> <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"> <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>
<action issue="COLLECTIONS-529" dev="tn" type="add" due-to="Alexander Muthmann, Dipanjan Laha"> <action issue="COLLECTIONS-529" dev="tn" type="add" due-to="Alexander Muthmann, Dipanjan Laha">
Added methods "removeAll(...)" and "retainAll(...)" to "CollectionUtils" that perform Added methods "removeAll(...)" and "retainAll(...)" to "CollectionUtils" that perform

View File

@ -186,11 +186,17 @@ public final class CollectionBag<E> extends AbstractBagDecorator<E> {
/** /**
* <i>(Change)</i> * <i>(Change)</i>
* Remove any members of the bag that are not in the given * Remove any members of the bag that are not in the given collection,
* collection, <i>not</i> respecting cardinality. That is, any object * <i>not</i> respecting cardinality. That is, any object in the given
* in the given collection <code>coll</code> will be retained in the * collection <code>coll</code> will be retained in the bag with the same
* bag with the same number of copies prior to this operation. All * number of copies prior to this operation. All other objects will be
* other objects will be completely removed from this bag. * 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 * @param coll the collection to retain
* @return <code>true</code> if this call changed the collection * @return <code>true</code> if this call changed the collection