Hi all,

I recently took the time to have a good look at the new collections
library. It looks really really good - consistent, well-named,
comprehensive. Congrats to all involved.

I have a few minor javadoc patches to offer, the sort of things that (as
a newbie to collections) might have saved me a wee bit of
head-scratching. Feel free to adopt or ignore as you wish.


BidiMap: It wasn't until I got to the "put" method that I discovered the
major restriction of this class (no duplicate values). I thought that
this should perhaps have been mentioned up front.

BoundedCollection: Users don't normally use this class directly, but
instead use CollectionUtils.maxSize(coll), right? So it would be nice to
have a link to that method.

UnmodifiableBoundedCollection: the thought of a BoundedCollection
"losing" its boundedness when decorated is scary. What's really meant is
simply that the interface becomes inaccessable, no?

Factory: because PrototypeFactory is not a "known subclass" of the
Factory interface, I was a little puzzled about the reference in the
ConstantFactory class to "the prototype factory". I think a link would
make things clearer.


Regards,

Simon
Index: BidiMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/BidiMap.java,v
retrieving revision 1.14
diff -u -r1.14 BidiMap.java
--- BidiMap.java	18 Feb 2004 01:15:42 -0000	1.14
+++ BidiMap.java	13 Apr 2004 08:27:14 -0000
@@ -26,6 +26,11 @@
  * <p>
  * Implementations should allow a value to be looked up from a key and
  * a key to be looked up from a value with equal performance.
+ * <p>
+ * This map enforces the restriction that there is a 1:1 relation between
+ * keys and values, meaning that multiple keys cannot map to the same value. 
+ * This is required so that "inverting" the map results in a map without 
+ * duplicate keys. See the [EMAIL PROTECTED] #put} method description for more information.
  * 
  * @since Commons Collections 3.0
  * @version $Revision: 1.14 $ $Date: 2004/02/18 01:15:42 $
Index: BoundedCollection.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/BoundedCollection.java,v
retrieving revision 1.10
diff -u -r1.10 BoundedCollection.java
--- BoundedCollection.java	18 Feb 2004 01:15:42 -0000	1.10
+++ BoundedCollection.java	13 Apr 2004 08:27:33 -0000
@@ -24,6 +24,8 @@
  * maximum number of elements. This interface allows the querying of details
  * associated with the maximum number of elements.
  *
+ * @see CollectionUtils#maxSize
+ *
  * @since Commons Collections 3.0
  * @version $Revision: 1.10 $ $Date: 2004/02/18 01:15:42 $
  * 
Index: collection/UnmodifiableBoundedCollection.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java,v
retrieving revision 1.6
diff -u -r1.6 UnmodifiableBoundedCollection.java
--- collection/UnmodifiableBoundedCollection.java	18 Feb 2004 00:58:53 -0000	1.6
+++ collection/UnmodifiableBoundedCollection.java	13 Apr 2004 08:27:56 -0000
@@ -22,11 +22,12 @@
 import org.apache.commons.collections.iterators.UnmodifiableIterator;
 
 /**
- * <code>UnmodifiableBoundedCollection</code> decorates another <code>BoundedCollection</code>
- * to ensure it can't be altered.
+ * <code>UnmodifiableBoundedCollection</code> decorates another 
+ * <code>BoundedCollection</code> to ensure it can't be altered.
  * <p>
  * If a BoundedCollection is first wrapped in some other collection decorator,
- * such as synchronized or predicated, the BoundedCollection nature is lost.
+ * such as synchronized or predicated, the BoundedCollection methods are no 
+ * longer accessable.
  * The factory on this class will attempt to retrieve the bounded nature by
  * examining the package scope variables.
  *
Index: Factory.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/Factory.java,v
retrieving revision 1.8
diff -r1.8 Factory.java
20a21,22
>  * @see org.apache.commons.collections.functors.PrototypeFactory
>  *

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to