From 2bf26f1d365160ece54dba75583d0d96f05e189d Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Sat, 15 May 2004 12:39:13 +0000 Subject: [PATCH] Javadoc git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131720 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/collection/CompositeCollection.java | 13 ++++++++++--- .../collection/PredicatedCollection.java | 3 ++- .../collection/SynchronizedCollection.java | 3 ++- .../collection/TransformedCollection.java | 3 ++- .../collections/collection/TypedCollection.java | 4 +++- .../collection/UnmodifiableBoundedCollection.java | 4 +++- .../collection/UnmodifiableCollection.java | 5 ++++- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/java/org/apache/commons/collections/collection/CompositeCollection.java b/src/java/org/apache/commons/collections/collection/CompositeCollection.java index 4ef5d181d..ee51c3c4a 100644 --- a/src/java/org/apache/commons/collections/collection/CompositeCollection.java +++ b/src/java/org/apache/commons/collections/collection/CompositeCollection.java @@ -33,7 +33,7 @@ import org.apache.commons.collections.list.UnmodifiableList; * strategy is provided then add and remove are unsupported. * * @since Commons Collections 3.0 - * @version $Revision: 1.5 $ $Date: 2004/02/18 00:58:53 $ + * @version $Revision: 1.6 $ $Date: 2004/05/15 12:39:13 $ * * @author Brian McCallister * @author Stephen Colebourne @@ -113,6 +113,7 @@ public class CompositeCollection implements Collection { *

* This implementation calls contains() on each collection. * + * @param obj the object to search for * @return true if obj is contained in any of the contained collections */ public boolean contains(Object obj) { @@ -163,9 +164,10 @@ public class CompositeCollection implements Collection { * Returns an object array, populating the supplied array if possible. * See Collection interface for full details. * + * @param array the array to use, populating if possible * @return an array of all the elements in the collection */ - public Object[] toArray(Object array[]) { + public Object[] toArray(Object[] array) { int size = this.size(); Object[] result = null; if (array.length >= size) { @@ -338,13 +340,18 @@ public class CompositeCollection implements Collection { /** * Add an additional collection to this composite. + * + * @param c the collection to add */ public void addComposited(Collection c) { this.addComposited(new Collection[]{c}); } /** - * Add two additional collection to this composite. + * Add two additional collections to this composite. + * + * @param c the first collection to add + * @param d the second collection to add */ public void addComposited(Collection c, Collection d) { this.addComposited(new Collection[]{c, d}); diff --git a/src/java/org/apache/commons/collections/collection/PredicatedCollection.java b/src/java/org/apache/commons/collections/collection/PredicatedCollection.java index 1935ad468..de23e2bec 100644 --- a/src/java/org/apache/commons/collections/collection/PredicatedCollection.java +++ b/src/java/org/apache/commons/collections/collection/PredicatedCollection.java @@ -28,7 +28,7 @@ import org.apache.commons.collections.Predicate; * is thrown. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:53 $ + * @version $Revision: 1.4 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne * @author Paul Jack @@ -46,6 +46,7 @@ public class PredicatedCollection extends AbstractCollectionDecorator { * * @param coll the collection to decorate, must not be null * @param predicate the predicate to use for validation, must not be null + * @return a new predicated collection * @throws IllegalArgumentException if collection or predicate is null * @throws IllegalArgumentException if the collection contains invalid elements */ diff --git a/src/java/org/apache/commons/collections/collection/SynchronizedCollection.java b/src/java/org/apache/commons/collections/collection/SynchronizedCollection.java index 4cdb8f429..ab44b5a47 100644 --- a/src/java/org/apache/commons/collections/collection/SynchronizedCollection.java +++ b/src/java/org/apache/commons/collections/collection/SynchronizedCollection.java @@ -31,7 +31,7 @@ import java.util.Iterator; * * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2004/02/18 00:58:53 $ + * @version $Revision: 1.5 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne */ @@ -46,6 +46,7 @@ public class SynchronizedCollection implements Collection { * Factory method to create a synchronized collection. * * @param coll the collection to decorate, must not be null + * @return a new synchronized collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) { diff --git a/src/java/org/apache/commons/collections/collection/TransformedCollection.java b/src/java/org/apache/commons/collections/collection/TransformedCollection.java index 5b6cff459..8af5e4345 100644 --- a/src/java/org/apache/commons/collections/collection/TransformedCollection.java +++ b/src/java/org/apache/commons/collections/collection/TransformedCollection.java @@ -31,7 +31,7 @@ import org.apache.commons.collections.Transformer; * use the Integer form to remove objects. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2004/02/18 00:58:53 $ + * @version $Revision: 1.5 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne */ @@ -48,6 +48,7 @@ public class TransformedCollection extends AbstractCollectionDecorator { * * @param coll the collection to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null + * @return a new transformed collection * @throws IllegalArgumentException if collection or transformer is null */ public static Collection decorate(Collection coll, Transformer transformer) { diff --git a/src/java/org/apache/commons/collections/collection/TypedCollection.java b/src/java/org/apache/commons/collections/collection/TypedCollection.java index 9ae442823..43b9cbaf2 100644 --- a/src/java/org/apache/commons/collections/collection/TypedCollection.java +++ b/src/java/org/apache/commons/collections/collection/TypedCollection.java @@ -27,7 +27,7 @@ import org.apache.commons.collections.functors.InstanceofPredicate; * collection, an IllegalArgumentException is thrown. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $ + * @version $Revision: 1.5 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne * @author Matthew Hawthorne @@ -42,6 +42,7 @@ public class TypedCollection { * * @param coll the collection to decorate, must not be null * @param type the type to allow into the collection, must not be null + * @return a new typed collection * @throws IllegalArgumentException if collection or type is null * @throws IllegalArgumentException if the collection contains invalid elements */ @@ -53,6 +54,7 @@ public class TypedCollection { * Restrictive constructor. */ protected TypedCollection() { + super(); } } diff --git a/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java b/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java index 592385690..a7f14a5b1 100644 --- a/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java +++ b/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java @@ -32,7 +32,7 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator; * examining the package scope variables. * * @since Commons Collections 3.0 - * @version $Revision: 1.7 $ $Date: 2004/04/14 20:11:45 $ + * @version $Revision: 1.8 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne */ @@ -42,6 +42,7 @@ public final class UnmodifiableBoundedCollection extends AbstractCollectionDecor * Factory method to create an unmodifiable bounded collection. * * @param coll the BoundedCollection to decorate, must not be null + * @return a new unmodifiable bounded collection * @throws IllegalArgumentException if bag is null */ public static BoundedCollection decorate(BoundedCollection coll) { @@ -55,6 +56,7 @@ public final class UnmodifiableBoundedCollection extends AbstractCollectionDecor * to find a suitable BoundedCollection. * * @param coll the BoundedCollection to decorate, must not be null + * @return a new unmodifiable bounded collection * @throws IllegalArgumentException if bag is null */ public static BoundedCollection decorateUsing(Collection coll) { diff --git a/src/java/org/apache/commons/collections/collection/UnmodifiableCollection.java b/src/java/org/apache/commons/collections/collection/UnmodifiableCollection.java index aaa9b185e..0cb6f97be 100644 --- a/src/java/org/apache/commons/collections/collection/UnmodifiableCollection.java +++ b/src/java/org/apache/commons/collections/collection/UnmodifiableCollection.java @@ -25,7 +25,7 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator; * Decorates another Collection to ensure it can't be altered. * * @since Commons Collections 3.0 - * @version $Revision: 1.5 $ $Date: 2004/02/18 00:58:53 $ + * @version $Revision: 1.6 $ $Date: 2004/05/15 12:39:13 $ * * @author Stephen Colebourne */ @@ -33,8 +33,11 @@ public final class UnmodifiableCollection extends AbstractCollectionDecorator im /** * Factory method to create an unmodifiable collection. + *

+ * If the collection passed in is already unmodifiable, it is returned. * * @param coll the collection to decorate, must not be null + * @return an unmodifiable collection * @throws IllegalArgumentException if collection is null */ public static Collection decorate(Collection coll) {