[COLLECTIONS-544] Documented runtime complexity of CollectionUtils.retainAll(Collection, Collection). Thanks to Oswaldo Olivo.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1651098 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f59e419683
commit
9e64a3cb81
|
@ -22,6 +22,9 @@
|
|||
<body>
|
||||
|
||||
<release version="4.1" date="TBD" description="">
|
||||
<action issue="COLLECTIONS-544" dev="tn" type="fix" due-to="Oswaldo Olivo">
|
||||
Documented runtime complexity of "CollectionUtils#retainAll(Collection, Collection).
|
||||
</action>
|
||||
<action issue="COLLECTIONS-542" dev="tn" type="fix">
|
||||
"AbstractHashedMap" still inherits from "AbstractMap", contrary to what
|
||||
the class javadoc stated. The inheritance will now be removed in v5.0.
|
||||
|
|
|
@ -1883,6 +1883,12 @@ public class CollectionUtils {
|
|||
* in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which
|
||||
* case the cardinality is zero. This method is useful if you do not wish to modify
|
||||
* the collection <code>c</code> and thus cannot call <code>c.retainAll(retain);</code>.
|
||||
* <p>
|
||||
* This implementation iterates over <code>collection</code>, checking each element in
|
||||
* turn to see if it's contained in <code>retain</code>. If it's contained, it's added
|
||||
* to the returned list. As a consequence, it is advised to use a collection type for
|
||||
* <code>retain</code> that provides a fast (e.g. O(1)) implementation of
|
||||
* {@link Collection#contains(Object)}.
|
||||
*
|
||||
* @param <C> the type of object the {@link Collection} contains
|
||||
* @param collection the collection whose contents are the target of the #retailAll operation
|
||||
|
|
Loading…
Reference in New Issue