Author: scolebourne Date: Mon Nov 21 15:24:45 2005 New Revision: 348013 URL: http://svn.apache.org/viewcvs?rev=348013&view=rev Log: Add since tags for 3.2
Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/BufferUtils.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/CollectionUtils.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ExtendedProperties.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/IteratorUtils.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/list/CursorableLinkedList.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedMap.java jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedSortedMap.java Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/BufferUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/BufferUtils.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/BufferUtils.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/BufferUtils.java Mon Nov 21 15:24:45 2005 @@ -97,6 +97,7 @@ * @param buffer the buffer to synchronize, must not be null * @return a blocking buffer backed by that buffer * @throws IllegalArgumentException if the Buffer is null + * @since Commons Collections 3.2 */ public static Buffer timeoutBuffer(Buffer buffer, long timeout) { return TimeoutBuffer.decorate(buffer, timeout); Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/CollectionUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/CollectionUtils.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/CollectionUtils.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/CollectionUtils.java Mon Nov 21 15:24:45 2005 @@ -643,6 +643,7 @@ * @param object the object to add, if null it will not be added * @return true if the collection changed * @throws NullPointerException if the collection is null + * @since Commons Collections 3.2 */ public static boolean addIgnoreNull(Collection collection, Object object) { return (object == null ? false : collection.add(object)); @@ -1082,6 +1083,46 @@ //----------------------------------------------------------------------- /** + * Returns a collection containing all the elements in <code>collection</code> + * that are also in <code>retain</code>. The cardinality of an element <code>e</code> + * in the returned collection is the same as the cardinality of <code>e</code> + * in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which + * case the cardinality is zero. This method is useful if you do not wish to modify + * the collection <code>c</code> and thus cannot call <code>c.retainAll(retain);</code>. + * + * @param collection the collection whose contents are the target of the #retailAll operation + * @param retain the collection containing the elements to be retained in the returned collection + * @return a <code>Collection</code> containing all the elements of <code>collection</code> + * that occur at least once in <code>retain</code>. + * @throws NullPointerException if either parameter is null + * @since Commons Collections 3.2 + */ + public static Collection retainAll(Collection collection, Collection retain) { + return ListUtils.retainAll(collection, retain); + } + + /** + * Removes the elements in <code>remove</code> from <code>collection</code>. That is, this + * method returns a collection containing all the elements in <code>c</code> + * that are not in <code>remove</code>. The cardinality of an element <code>e</code> + * in the returned collection is the same as the cardinality of <code>e</code> + * in <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which + * case the cardinality is zero. This method is useful if you do not wish to modify + * the collection <code>c</code> and thus cannot call <code>collection.removeAll(remove);</code>. + * + * @param collection the collection from which items are removed (in the returned collection) + * @param remove the items to be removed from the returned <code>collection</code> + * @return a <code>Collection</code> containing all the elements of <code>collection</code> except + * any elements that also occur in <code>remove</code>. + * @throws NullPointerException if either parameter is null + * @since Commons Collections 3.2 + */ + public static Collection removeAll(Collection collection, Collection remove) { + return ListUtils.retainAll(collection, remove); + } + + //----------------------------------------------------------------------- + /** * Returns a synchronized collection backed by the given collection. * <p> * You must manually synchronize on the returned buffer's iterator to @@ -1164,43 +1205,6 @@ */ public static Collection transformedCollection(Collection collection, Transformer transformer) { return TransformedCollection.decorate(collection, transformer); - } - - /** - * Returns a collection containing all the elements in <code>collection</code> - * that are also in <code>retain</code>. The cardinality of an element <code>e</code> - * in the returned collection is the same as the cardinality of <code>e</code> - * in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which - * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection <code>c</code> and thus cannot call <code>c.retainAll(retain);</code>. - * - * @param collection the collection whose contents are the target of the #retailAll operation - * @param retain the collection containing the elements to be retained in the returned collection - * @return a <code>Collection</code> containing all the elements of <code>collection</code> - * that occur at least once in <code>retain</code>. - * @throws NullPointerException if either parameter is null - */ - public static Collection retainAll(Collection collection, Collection retain) { - return ListUtils.retainAll(collection, retain); - } - - /** - * Removes the elements in <code>remove</code> from <code>collection</code>. That is, this - * method returns a collection containing all the elements in <code>c</code> - * that are not in <code>remove</code>. The cardinality of an element <code>e</code> - * in the returned collection is the same as the cardinality of <code>e</code> - * in <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which - * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection <code>c</code> and thus cannot call <code>collection.removeAll(remove);</code>. - * - * @param collection the collection from which items are removed (in the returned collection) - * @param remove the items to be removed from the returned <code>collection</code> - * @return a <code>Collection</code> containing all the elements of <code>collection</code> except - * any elements that also occur in <code>remove</code>. - * @throws NullPointerException if either parameter is null - */ - public static Collection removeAll(Collection collection, Collection remove) { - return ListUtils.retainAll(collection, remove); } } Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ExtendedProperties.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ExtendedProperties.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ExtendedProperties.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ExtendedProperties.java Mon Nov 21 15:24:45 2005 @@ -1082,6 +1082,7 @@ * @return The associated List object. * @throws ClassCastException is thrown if the key maps to an * object that is not a List. + * @since Commons Collections 3.2 */ public List getList(String key) { return getList(key, null); @@ -1098,6 +1099,7 @@ * @return The associated List. * @throws ClassCastException is thrown if the key maps to an * object that is not a List. + * @since Commons Collections 3.2 */ public List getList(String key, List defaultValue) { Object value = get(key); Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/IteratorUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/IteratorUtils.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/IteratorUtils.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/IteratorUtils.java Mon Nov 21 15:24:45 2005 @@ -695,6 +695,7 @@ * @param list the list to iterate over, not null * @return a new looping iterator * @throws NullPointerException if the list is null + * @since Commons Collections 3.2 */ public static ResettableIterator loopingListIterator(List list) { if (list == null) { Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/ListUtils.java Mon Nov 21 15:24:45 2005 @@ -220,6 +220,61 @@ //----------------------------------------------------------------------- /** + * Returns a List containing all the elements in <code>collection</code> + * that are also in <code>retain</code>. The cardinality of an element <code>e</code> + * in the returned list is the same as the cardinality of <code>e</code> + * in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which + * case the cardinality is zero. This method is useful if you do not wish to modify + * the collection <code>c</code> and thus cannot call <code>collection.retainAll(retain);</code>. + * + * @param collection the collection whose contents are the target of the #retailAll operation + * @param retain the collection containing the elements to be retained in the returned collection + * @return a <code>List</code> containing all the elements of <code>c</code> + * that occur at least once in <code>retain</code>. + * @throws NullPointerException if either parameter is null + * @since Commons Collections 3.2 + */ + public static List retainAll(Collection collection, Collection retain) { + List list = new ArrayList(Math.min(collection.size(), retain.size())); + + for (Iterator iter = collection.iterator(); iter.hasNext();) { + Object obj = iter.next(); + if (retain.contains(obj)) { + list.add(obj); + } + } + return list; + } + + /** + * Removes the elements in <code>remove</code> from <code>collection</code>. That is, this + * method returns a list containing all the elements in <code>c</code> + * that are not in <code>remove</code>. The cardinality of an element <code>e</code> + * in the returned collection is the same as the cardinality of <code>e</code> + * in <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which + * case the cardinality is zero. This method is useful if you do not wish to modify + * <code>collection</code> and thus cannot call <code>collection.removeAll(remove);</code>. + * + * @param collection the collection from which items are removed (in the returned collection) + * @param remove the items to be removed from the returned <code>collection</code> + * @return a <code>List</code> containing all the elements of <code>c</code> except + * any elements that also occur in <code>remove</code>. + * @throws NullPointerException if either parameter is null + * @since Commons Collections 3.2 + */ + public static List removeAll(Collection collection, Collection remove) { + List list = new ArrayList(); + for (Iterator iter = collection.iterator(); iter.hasNext();) { + Object obj = iter.next(); + if (remove.contains(obj) == false) { + list.add(obj); + } + } + return list; + } + + //----------------------------------------------------------------------- + /** * Returns a synchronized list backed by the given list. * <p> * You must manually synchronize on the returned buffer's iterator to @@ -349,58 +404,6 @@ */ public static List fixedSizeList(List list) { return FixedSizeList.decorate(list); - } - - /** - * Returns a List containing all the elements in <code>collection</code> - * that are also in <code>retain</code>. The cardinality of an element <code>e</code> - * in the returned list is the same as the cardinality of <code>e</code> - * in <code>collection</code> unless <code>retain</code> does not contain <code>e</code>, in which - * case the cardinality is zero. This method is useful if you do not wish to modify - * the collection <code>c</code> and thus cannot call <code>collection.retainAll(retain);</code>. - * - * @param collection the collection whose contents are the target of the #retailAll operation - * @param retain the collection containing the elements to be retained in the returned collection - * @return a <code>List</code> containing all the elements of <code>c</code> - * that occur at least once in <code>retain</code>. - * @throws NullPointerException if either parameter is null - */ - public static List retainAll(Collection collection, Collection retain) { - List list = new ArrayList(Math.min(collection.size(), retain.size())); - - for (Iterator iter = collection.iterator(); iter.hasNext();) { - Object obj = iter.next(); - if (retain.contains(obj)) { - list.add(obj); - } - } - return list; - } - - /** - * Removes the elements in <code>remove</code> from <code>collection</code>. That is, this - * method returns a list containing all the elements in <code>c</code> - * that are not in <code>remove</code>. The cardinality of an element <code>e</code> - * in the returned collection is the same as the cardinality of <code>e</code> - * in <code>collection</code> unless <code>remove</code> contains <code>e</code>, in which - * case the cardinality is zero. This method is useful if you do not wish to modify - * <code>collection</code> and thus cannot call <code>collection.removeAll(remove);</code>. - * - * @param collection the collection from which items are removed (in the returned collection) - * @param remove the items to be removed from the returned <code>collection</code> - * @return a <code>List</code> containing all the elements of <code>c</code> except - * any elements that also occur in <code>remove</code>. - * @throws NullPointerException if either parameter is null - */ - public static List removeAll(Collection collection, Collection remove) { - List list = new ArrayList(); - for (Iterator iter = collection.iterator(); iter.hasNext();) { - Object obj = iter.next(); - if (remove.contains(obj) == false) { - list.add(obj); - } - } - return list; } } Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java Mon Nov 21 15:24:45 2005 @@ -117,6 +117,7 @@ * @param timeout the timeout value in milliseconds * @throws BufferUnderflowException if an interrupt is received * @throws BufferUnderflowException if the timeout expires + * @since Commons Collections 3.2 */ public Object get(final long timeout) { synchronized (lock) { @@ -167,6 +168,7 @@ * @param timeout the timeout value in milliseconds * @throws BufferUnderflowException if an interrupt is received * @throws BufferUnderflowException if the timeout expires + * @since Commons Collections 3.2 */ public Object remove(final long timeout) { synchronized (lock) { Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/list/CursorableLinkedList.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/list/CursorableLinkedList.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/list/CursorableLinkedList.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/list/CursorableLinkedList.java Mon Nov 21 15:24:45 2005 @@ -558,6 +558,8 @@ //----------------------------------------------------------------------- /** * A cursor for the sublist based on LinkedSubListIterator. + * + * @since Commons Collections 3.2 */ protected static class SubCursor extends Cursor { Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedMap.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedMap.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedMap.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedMap.java Mon Nov 21 15:24:45 2005 @@ -85,6 +85,7 @@ * @param keyTransformer the transformer to use for key conversion, null means no transformation * @param valueTransformer the transformer to use for value conversion, null means no transformation * @throws IllegalArgumentException if map is null + * @since Commons Collections 3.2 */ public static Map decorateTransform(Map map, Transformer keyTransformer, Transformer valueTransformer) { TransformedMap decorated = new TransformedMap(map, keyTransformer, valueTransformer); Modified: jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedSortedMap.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedSortedMap.java?rev=348013&r1=348012&r2=348013&view=diff ============================================================================== --- jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedSortedMap.java (original) +++ jakarta/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/TransformedSortedMap.java Mon Nov 21 15:24:45 2005 @@ -77,6 +77,7 @@ * @param keyTransformer the transformer to use for key conversion, null means no transformation * @param valueTransformer the transformer to use for value conversion, null means no transformation * @throws IllegalArgumentException if map is null + * @since Commons Collections 3.2 */ public static SortedMap decorateTransform(SortedMap map, Transformer keyTransformer, Transformer valueTransformer) { TransformedSortedMap decorated = new TransformedSortedMap(map, keyTransformer, valueTransformer); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]