scolebourne    2004/05/21 14:38:49

  Modified:    collections/src/java/org/apache/commons/collections/collection
                        PredicatedCollection.java
               collections/src/java/org/apache/commons/collections/bag
                        PredicatedBag.java PredicatedSortedBag.java
               collections/src/java/org/apache/commons/collections/list
                        PredicatedList.java
               collections/src/java/org/apache/commons/collections/set
                        PredicatedSortedSet.java PredicatedSet.java
               collections/src/java/org/apache/commons/collections/buffer
                        PredicatedBuffer.java
               collections/src/java/org/apache/commons/collections/map
                        PredicatedSortedMap.java PredicatedMap.java
  Log:
  Javadoc how to use Predicated classes

  bug 29018
  
  Revision  Changes    Path
  1.5       +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/collection/PredicatedCollection.java
  
  Index: PredicatedCollection.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/collection/PredicatedCollection.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PredicatedCollection.java 15 May 2004 12:39:13 -0000      1.4
  +++ PredicatedCollection.java 21 May 2004 21:38:40 -0000      1.5
  @@ -24,8 +24,12 @@
    * Decorates another <code>Collection</code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the collection, an IllegalArgumentException
  - * is thrown.
  + * This collection exists to provide validation for the decorated collection.
  + * It is normally created to decorate an empty collection.
  + * If an object cannot be added to the collection, an IllegalArgumentException is 
thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the collection.
  + * <pre>Collection coll = PredicatedCollection.decorate(new ArrayList(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.6       +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedBag.java
  
  Index: PredicatedBag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedBag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PredicatedBag.java        15 May 2004 12:27:04 -0000      1.5
  +++ PredicatedBag.java        21 May 2004 21:38:40 -0000      1.6
  @@ -25,8 +25,12 @@
    * Decorates another <code>Bag</code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the list, an IllegalArgumentException
  - * is thrown.
  + * This bag exists to provide validation for the decorated bag.
  + * It is normally created to decorate an empty bag.
  + * If an object cannot be added to the bag, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the bag.
  + * <pre>Bag bag = PredicatedBag.decorate(new HashBag(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.6       +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedSortedBag.java
  
  Index: PredicatedSortedBag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/PredicatedSortedBag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PredicatedSortedBag.java  15 May 2004 12:27:04 -0000      1.5
  +++ PredicatedSortedBag.java  21 May 2004 21:38:40 -0000      1.6
  @@ -24,8 +24,12 @@
    * Decorates another <code>SortedBag</code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the list, an IllegalArgumentException
  - * is thrown.
  + * This bag exists to provide validation for the decorated bag.
  + * It is normally created to decorate an empty bag.
  + * If an object cannot be added to the bag, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the bag.
  + * <pre>SortedBag bag = PredicatedSortedBag.decorate(new TreeBag(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.4       +6 -1      
jakarta-commons/collections/src/java/org/apache/commons/collections/list/PredicatedList.java
  
  Index: PredicatedList.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/list/PredicatedList.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PredicatedList.java       18 Feb 2004 01:12:26 -0000      1.3
  +++ PredicatedList.java       21 May 2004 21:38:40 -0000      1.4
  @@ -28,7 +28,12 @@
    * Decorates another <code>List</code> to validate that all additions
    * match a specified predicate.
    * <p>
  + * This list exists to provide validation for the decorated list.
  + * It is normally created to decorate an empty list.
    * If an object cannot be added to the list, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the list.
  + * <pre>List list = PredicatedList.decorate(new ArrayList(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.4       +6 -1      
jakarta-commons/collections/src/java/org/apache/commons/collections/set/PredicatedSortedSet.java
  
  Index: PredicatedSortedSet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/set/PredicatedSortedSet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PredicatedSortedSet.java  18 Feb 2004 01:14:27 -0000      1.3
  +++ PredicatedSortedSet.java  21 May 2004 21:38:42 -0000      1.4
  @@ -24,7 +24,12 @@
    * Decorates another <code>SortedSet</code> to validate that all additions
    * match a specified predicate.
    * <p>
  + * This set exists to provide validation for the decorated set.
  + * It is normally created to decorate an empty set.
    * If an object cannot be added to the set, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the set.
  + * <pre>SortedSet set = PredicatedSortedSet.decorate(new TreeSet(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.4       +6 -1      
jakarta-commons/collections/src/java/org/apache/commons/collections/set/PredicatedSet.java
  
  Index: PredicatedSet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/set/PredicatedSet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PredicatedSet.java        18 Feb 2004 01:14:27 -0000      1.3
  +++ PredicatedSet.java        21 May 2004 21:38:42 -0000      1.4
  @@ -24,7 +24,12 @@
    * Decorates another <code>Set</code> to validate that all additions
    * match a specified predicate.
    * <p>
  + * This set exists to provide validation for the decorated set.
  + * It is normally created to decorate an empty set.
    * If an object cannot be added to the set, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the set.
  + * <pre>Set set = PredicatedSet.decorate(new HashSet(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.5       +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java
  
  Index: PredicatedBuffer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PredicatedBuffer.java     15 May 2004 12:33:23 -0000      1.4
  +++ PredicatedBuffer.java     21 May 2004 21:38:48 -0000      1.5
  @@ -23,8 +23,12 @@
    * Decorates another <code>Buffer</code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the collection, an IllegalArgumentException
  - * is thrown.
  + * This buffer exists to provide validation for the decorated buffer.
  + * It is normally created to decorate an empty buffer.
  + * If an object cannot be added to the buffer, an IllegalArgumentException is 
thrown.
  + * <p>
  + * One usage would be to ensure that no null entries are added to the buffer.
  + * <pre>Buffer buffer = PredicatedBuffer.decorate(new UnboundedFifoBuffer(), 
NotNullPredicate.INSTANCE);</pre>
    *
    * @since Commons Collections 3.0
    * @version $Revision$ $Date$
  
  
  
  1.7       +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/map/PredicatedSortedMap.java
  
  Index: PredicatedSortedMap.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/PredicatedSortedMap.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PredicatedSortedMap.java  9 Apr 2004 10:36:01 -0000       1.6
  +++ PredicatedSortedMap.java  21 May 2004 21:38:49 -0000      1.7
  @@ -24,8 +24,12 @@
    * Decorates another <code>SortedMap </code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the map, an IllegalArgumentException
  - * is thrown.
  + * This map exists to provide validation for the decorated map.
  + * It is normally created to decorate an empty map.
  + * If an object cannot be added to the map, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null keys are added to the map.
  + * <pre>SortedMap map = PredicatedSortedSet.decorate(new TreeMap(), 
NotNullPredicate.INSTANCE, null);</pre>
    * <p>
    * This class is Serializable from Commons Collections 3.1.
    *
  
  
  
  1.12      +7 -3      
jakarta-commons/collections/src/java/org/apache/commons/collections/map/PredicatedMap.java
  
  Index: PredicatedMap.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/PredicatedMap.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PredicatedMap.java        7 May 2004 23:11:04 -0000       1.11
  +++ PredicatedMap.java        21 May 2004 21:38:49 -0000      1.12
  @@ -28,8 +28,12 @@
    * Decorates another <code>Map</code> to validate that additions
    * match a specified predicate.
    * <p>
  - * If an object cannot be added to the map, an IllegalArgumentException
  - * is thrown.
  + * This map exists to provide validation for the decorated map.
  + * It is normally created to decorate an empty map.
  + * If an object cannot be added to the map, an IllegalArgumentException is thrown.
  + * <p>
  + * One usage would be to ensure that no null keys are added to the map.
  + * <pre>Map map = PredicatedSet.decorate(new HashMap(), NotNullPredicate.INSTANCE, 
null);</pre>
    * <p>
    * This class is Serializable from Commons Collections 3.1.
    *
  
  
  

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

Reply via email to