Cleanup of collection package.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1356933 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-07-03 20:49:03 +00:00
parent a9b11e2cf2
commit b24253a157
10 changed files with 56 additions and 75 deletions

View File

@ -37,10 +37,7 @@ import java.util.Iterator;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @author Paul Jack
* @version $Id$
*/
public abstract class AbstractCollectionDecorator<E>
implements Collection<E>, Serializable {

View File

@ -38,12 +38,8 @@ import java.util.Collection;
*
* @param <D> the type of the elements in the decorated collection
* @param <E> the element type of the Collection implementation
* @since Commons Collections 5
* @version $Revision$
*
* @author Stephen Colebourne
* @author Paul Jack
* @author Matt Benson
* @since Commons Collections 4.0
* @version $Id$
*/
public abstract class AbstractUntypedCollectionDecorator<E, D> implements Collection<E>, Serializable {

View File

@ -37,11 +37,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Brian McCallister
* @author Stephen Colebourne
* @author Phil Steitz
* @version $Id$
*/
public class CompositeCollection<E> implements Collection<E>, Serializable {
@ -190,6 +186,7 @@ public class CompositeCollection<E> implements Collection<E>, Serializable {
* Returns an object array, populating the supplied array if possible.
* See <code>Collection</code> interface for full details.
*
* @param <T> the type of the elements in the collection
* @param array the array to use, populating if possible
* @return an array of all the elements in the collection
*/
@ -220,7 +217,7 @@ public class CompositeCollection<E> implements Collection<E>, Serializable {
* unless a CollectionMutator strategy is specified.
*
* @param obj the object to add
* @return true if the collection was modified
* @return {@code true} if the collection was modified
* @throws UnsupportedOperationException if CollectionMutator hasn't been set
* @throws UnsupportedOperationException if add is unsupported
* @throws ClassCastException if the object cannot be added due to its type
@ -464,7 +461,9 @@ public class CompositeCollection<E> implements Collection<E>, Serializable {
* @throws NullPointerException if the object cannot be added because its null
* @throws IllegalArgumentException if the object cannot be added
*/
public boolean addAll(CompositeCollection<E> composite, List<Collection<E>> collections, Collection<? extends E> coll);
public boolean addAll(CompositeCollection<E> composite,
List<Collection<E>> collections,
Collection<? extends E> coll);
/**
* Called when an object is to be removed to the composite.

View File

@ -21,7 +21,7 @@ import java.util.Collection;
import org.apache.commons.collections.Predicate;
/**
* Decorates another <code>Collection</code> to validate that additions
* Decorates another {@link Collection} to validate that additions
* match a specified predicate.
* <p>
* This collection exists to provide validation for the decorated collection.
@ -35,10 +35,7 @@ import org.apache.commons.collections.Predicate;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @author Paul Jack
* @version $Id$
*/
public class PredicatedCollection<E> extends AbstractCollectionDecorator<E> {

View File

@ -21,7 +21,7 @@ import java.util.Collection;
import java.util.Iterator;
/**
* Decorates another <code>Collection</code> to synchronize its behaviour
* Decorates another {@link Collection} to synchronize its behaviour
* for a multi-threaded environment.
* <p>
* Iterators must be manually synchronized:
@ -36,9 +36,7 @@ import java.util.Iterator;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @version $Id$
*/
public class SynchronizedCollection<E> implements Collection<E>, Serializable {

View File

@ -23,7 +23,7 @@ import java.util.List;
import org.apache.commons.collections.Transformer;
/**
* Decorates another <code>Collection</code> to transform objects that are added.
* Decorates another {@link Collection} to transform objects that are added.
* <p>
* The add methods are affected by this class.
* Thus objects must be removed or searched for using their transformed form.
@ -34,9 +34,7 @@ import org.apache.commons.collections.Transformer;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @version $Id$
*/
public class TransformedCollection<E> extends AbstractCollectionDecorator<E> {

View File

@ -23,8 +23,8 @@ import org.apache.commons.collections.BoundedCollection;
import org.apache.commons.collections.iterators.UnmodifiableIterator;
/**
* <code>UnmodifiableBoundedCollection</code> decorates another
* <code>BoundedCollection</code> to ensure it can't be altered.
* {@link UnmodifiableBoundedCollection} decorates another
* {@link BoundedCollection} 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 methods are no
@ -37,9 +37,7 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
* Attempts to modify it will result in an UnsupportedOperationException.
*
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @version $Id$
*/
public final class UnmodifiableBoundedCollection<E> extends AbstractCollectionDecorator<E>
implements BoundedCollection<E> {

View File

@ -23,7 +23,7 @@ import org.apache.commons.collections.Unmodifiable;
import org.apache.commons.collections.iterators.UnmodifiableIterator;
/**
* Decorates another <code>Collection</code> to ensure it can't be altered.
* Decorates another {@link Collection} to ensure it can't be altered.
* <p>
* This class is Serializable from Commons Collections 3.1.
* <p>
@ -31,9 +31,7 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
*
* @param <E> the type of the elements in the collection
* @since Commons Collections 3.0
* @version $Revision$
*
* @author Stephen Colebourne
* @version $Id$
*/
public final class UnmodifiableCollection<E>
extends AbstractCollectionDecorator<E>

View File

@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This package contains implementations of the
* {@link java.util.Collection Collection} interface.
* <p>
* The following implementations are provided in the package:
* <ul>
* <li>CompositeCollection - a collection that combines multiple collections into one
* </ul>
* The following decorators are provided in the package:
* <ul>
* <li>Synchronized - synchronizes method access for multi-threaded environments
* <li>Unmodifiable - ensures the collection cannot be altered
* <li>Predicated - ensures that only elements that are valid according to a predicate can be added
* <li>Typed - ensures that only elements that are of a specific type can be added
* <li>Transformed - transforms elements as they are added
* </ul>
*
* @version $Id$
*/
package org.apache.commons.collections.collection;

View File

@ -1,36 +0,0 @@
<!-- $Id$ -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<BODY>
<p>
This package contains implementations of the
{@link java.util.Collection Collection} interface.
<p>
The following implementations are provided in the package:
<ul>
<li>CompositeCollection - a collection that combines multiple collections into one
</ul>
The following decorators are provided in the package:
<ul>
<li>Synchronized - synchronizes method access for multi-threaded environments
<li>Unmodifiable - ensures the collection cannot be altered
<li>Predicated - ensures that only elements that are valid according to a predicate can be added
<li>Typed - ensures that only elements that are of a specific type can be added
<li>Transformed - transforms elements as they are added
</ul>
</pre>
</BODY>