diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9ce2ad4a8..c924bc0c0 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,9 @@ + + AbstractUntypedCollectionDecorator is not used. + Added method "ListUtils#longestCommonSubsequence(List, List)". diff --git a/src/main/java/org/apache/commons/collections4/collection/AbstractUntypedCollectionDecorator.java b/src/main/java/org/apache/commons/collections4/collection/AbstractUntypedCollectionDecorator.java deleted file mode 100644 index 493214294..000000000 --- a/src/main/java/org/apache/commons/collections4/collection/AbstractUntypedCollectionDecorator.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ -package org.apache.commons.collections4.collection; - -import java.io.Serializable; -import java.util.Collection; - -/** - * Decorates another Collection to provide additional behaviour - * without guaranteeing that the provided Collection type is the - * same as that of the decorated Collection. - *

- * Each untyped method call made on this Collection is forwarded to the - * decorated Collection. This class is used as a framework on which - * to build to extensions such as synchronized and unmodifiable behaviour. The - * main advantage of decoration is that one decorator can wrap any - * implementation of Collection, whereas sub-classing requires a - * new class to be written for each implementation. - *

- * This implementation does not perform any special processing with - * {@link #iterator()}. Instead it simply returns the value from the wrapped - * collection. This may be undesirable, for example if you are trying to write - * an unmodifiable implementation it might provide a loophole. - * - * @param the type of the elements in the decorated collection - * @param the element type of the Collection implementation - * @since 4.0 - * @version $Id$ - */ -public abstract class AbstractUntypedCollectionDecorator implements Collection, Serializable { - - /** Serialization version */ - private static final long serialVersionUID = -8016691444524268856L; - - /** The collection being decorated */ - protected Collection collection; - - /** - * Create a new AbstractUntypedCollectionDecorator. - */ - public AbstractUntypedCollectionDecorator() { - super(); - } - - /** - * Constructor that wraps (not copies). - * - * @param coll the collection to decorate, must not be null - * @throws IllegalArgumentException if the collection is null - */ - protected AbstractUntypedCollectionDecorator(final Collection coll) { - if (coll == null) { - throw new IllegalArgumentException("Collection must not be null"); - } - this.collection = coll; - } - - /** - * Gets the collection being decorated. All access to the decorated - * collection goes via this method. - * - * @return the decorated collection - */ - protected Collection decorated() { - return collection; - } - - public void clear() { - decorated().clear(); - } - - public boolean contains(final Object object) { - return decorated().contains(object); - } - - public boolean isEmpty() { - return decorated().isEmpty(); - } - - public boolean remove(final Object object) { - return decorated().remove(object); - } - - public int size() { - return decorated().size(); - } - - public Object[] toArray() { - return decorated().toArray(); - } - - public T[] toArray(final T[] object) { - return decorated().toArray(object); - } - - public boolean containsAll(final Collection coll) { - return decorated().containsAll(coll); - } - - public boolean removeAll(final Collection coll) { - return decorated().removeAll(coll); - } - - public boolean retainAll(final Collection coll) { - return decorated().retainAll(coll); - } - - @Override - public boolean equals(final Object object) { - return object == this || decorated().equals(object); - } - - @Override - public int hashCode() { - return decorated().hashCode(); - } - - @Override - public String toString() { - return decorated().toString(); - } - -}