Author: tn
Date: Thu Sep 20 18:07:01 2012
New Revision: 1388146
URL: http://svn.apache.org/viewvc?rev=1388146&view=rev
Log:
[COLLECTIONS-415/417] Added clarifying javadoc about runtime complexity.
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/AbstractLinkedList.java
Modified:
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/AbstractLinkedList.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/AbstractLinkedList.java?rev=1388146&r1=1388145&r2=1388146&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/AbstractLinkedList.java
(original)
+++
commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/AbstractLinkedList.java
Thu Sep 20 18:07:01 2012
@@ -243,6 +243,15 @@ public abstract class AbstractLinkedList
return false;
}
+ /**
+ * {@inheritDoc}
+ * <p>
+ * This implementation iterates over the elements of this list, checking
each element in
+ * turn to see if it's contained in <code>coll</code>. If it's contained,
it's removed
+ * from this list. 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)}.
+ */
public boolean removeAll(Collection<?> coll) {
boolean modified = false;
Iterator<E> it = iterator();
@@ -257,6 +266,15 @@ public abstract class AbstractLinkedList
//-----------------------------------------------------------------------
+ /**
+ * {@inheritDoc}
+ * <p>
+ * This implementation iterates over the elements of this list, 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 list. 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)}.
+ */
public boolean retainAll(Collection<?> coll) {
boolean modified = false;
Iterator<E> it = iterator();