Class AbstractCollectionDecorator
- java.lang.Object
-
- org.apache.commons.collections.collection.AbstractCollectionDecorator
-
- All Implemented Interfaces:
Iterable,Collection
- Direct Known Subclasses:
AbstractBagDecorator,AbstractBufferDecorator,AbstractListDecorator,AbstractSerializableCollectionDecorator,AbstractSetDecorator
@Deprecated(since="2021-04-30") public abstract class AbstractCollectionDecorator extends Object implements Collection
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.Decorates anotherCollectionto provide additional behaviour.Each method call made on this
Collectionis forwarded to the decoratedCollection. 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 ofCollection, whereas sub-classing requires a new class to be written for each implementation.This implementation does not perform any special processing with
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.- Since:
- Commons Collections 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(Object object)Deprecated.booleanaddAll(Collection coll)Deprecated.voidclear()Deprecated.booleancontains(Object object)Deprecated.booleancontainsAll(Collection coll)Deprecated.booleanequals(Object object)Deprecated.inthashCode()Deprecated.booleanisEmpty()Deprecated.Iteratoriterator()Deprecated.booleanremove(Object object)Deprecated.booleanremoveAll(Collection coll)Deprecated.booleanretainAll(Collection coll)Deprecated.intsize()Deprecated.Object[]toArray()Deprecated.Object[]toArray(Object[] object)Deprecated.StringtoString()Deprecated.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Method Detail
-
add
public boolean add(Object object)
Deprecated.- Specified by:
addin interfaceCollection
-
addAll
public boolean addAll(Collection coll)
Deprecated.- Specified by:
addAllin interfaceCollection
-
clear
public void clear()
Deprecated.- Specified by:
clearin interfaceCollection
-
contains
public boolean contains(Object object)
Deprecated.- Specified by:
containsin interfaceCollection
-
isEmpty
public boolean isEmpty()
Deprecated.- Specified by:
isEmptyin interfaceCollection
-
iterator
public Iterator iterator()
Deprecated.- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable
-
remove
public boolean remove(Object object)
Deprecated.- Specified by:
removein interfaceCollection
-
size
public int size()
Deprecated.- Specified by:
sizein interfaceCollection
-
toArray
public Object[] toArray()
Deprecated.- Specified by:
toArrayin interfaceCollection
-
toArray
public Object[] toArray(Object[] object)
Deprecated.- Specified by:
toArrayin interfaceCollection
-
containsAll
public boolean containsAll(Collection coll)
Deprecated.- Specified by:
containsAllin interfaceCollection
-
removeAll
public boolean removeAll(Collection coll)
Deprecated.- Specified by:
removeAllin interfaceCollection
-
retainAll
public boolean retainAll(Collection coll)
Deprecated.- Specified by:
retainAllin interfaceCollection
-
equals
public boolean equals(Object object)
Deprecated.- Specified by:
equalsin interfaceCollection- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
Deprecated.- Specified by:
hashCodein interfaceCollection- Overrides:
hashCodein classObject
-
-