From 6e8052608a8214a50c45c5b450e2d3a287fdec83 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Sat, 20 Apr 2013 15:05:56 +0000 Subject: [PATCH] [COLLECTIONS-419] Added clarifying javadoc for AbstractDualBidiMap#retainAll. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1470170 13f79535-47bb-0310-9956-ffa450edef68 --- src/changes/changes.xml | 3 +++ .../collections4/bidimap/AbstractDualBidiMap.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index e0ca85a5e..5a527aa1f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,9 @@ + + Added clarifying javadoc wrt runtime complexity of "AbstractDualBidiMap#retainAll". + Improve performance of "TreeList#addAll" and "TreeList(Collection)" by converting the input collection into an AVL tree and efficiently merge it into the existing tree. diff --git a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java index 9915fb6a1..d983926b7 100644 --- a/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java +++ b/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java @@ -355,6 +355,15 @@ public abstract class AbstractDualBidiMap implements BidiMap { return modified; } + /** + * {@inheritDoc} + *

+ * This implementation iterates over the elements of this bidi map, checking each element in + * turn to see if it's contained in coll. If it's not contained, it's removed + * from this bidi map. As a consequence, it is advised to use a collection type for + * coll that provides a fast (e.g. O(1)) implementation of + * {@link Collection#contains(Object)}. + */ @Override public boolean retainAll(final Collection coll) { if (parent.isEmpty()) {