Class UnmodifiableBoundedCollection
- java.lang.Object
 - 
- org.apache.commons.collections.collection.AbstractCollectionDecorator
 - 
- org.apache.commons.collections.collection.AbstractSerializableCollectionDecorator
 - 
- org.apache.commons.collections.collection.UnmodifiableBoundedCollection
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,java.lang.Iterable,java.util.Collection,BoundedCollection
public final class UnmodifiableBoundedCollection extends AbstractSerializableCollectionDecorator implements BoundedCollection
UnmodifiableBoundedCollectiondecorates anotherBoundedCollectionto ensure it can't be altered.If a BoundedCollection is first wrapped in some other collection decorator, such as synchronized or predicated, the BoundedCollection methods are no longer accessible. The factory on this class will attempt to retrieve the bounded nature by examining the package scope variables.
This class is Serializable from Commons Collections 3.1.
- Since:
 - Commons Collections 3.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Object object)booleanaddAll(java.util.Collection coll)voidclear()static BoundedCollectiondecorate(BoundedCollection coll)Factory method to create an unmodifiable bounded collection.static BoundedCollectiondecorateUsing(java.util.Collection coll)Factory method to create an unmodifiable bounded collection.booleanisFull()Returns true if this collection is full and no new elements can be added.java.util.Iteratoriterator()intmaxSize()Gets the maximum size of the collection (the bound).booleanremove(java.lang.Object object)booleanremoveAll(java.util.Collection coll)booleanretainAll(java.util.Collection coll)- 
Methods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray, toString 
 - 
 
 - 
 
- 
- 
Method Detail
- 
decorate
public static BoundedCollection decorate(BoundedCollection coll)
Factory method to create an unmodifiable bounded collection.- Parameters:
 coll- theBoundedCollectionto decorate, must not be null- Returns:
 - a new unmodifiable bounded collection
 - Throws:
 java.lang.IllegalArgumentException- if bag is null
 
- 
decorateUsing
public static BoundedCollection decorateUsing(java.util.Collection coll)
Factory method to create an unmodifiable bounded collection.This method is capable of drilling down through up to 1000 other decorators to find a suitable BoundedCollection.
- Parameters:
 coll- theBoundedCollectionto decorate, must not be null- Returns:
 - a new unmodifiable bounded collection
 - Throws:
 java.lang.IllegalArgumentException- if bag is null
 
- 
iterator
public java.util.Iterator iterator()
- Specified by:
 iteratorin interfacejava.util.Collection- Specified by:
 iteratorin interfacejava.lang.Iterable- Overrides:
 iteratorin classAbstractCollectionDecorator
 
- 
add
public boolean add(java.lang.Object object)
- Specified by:
 addin interfacejava.util.Collection- Overrides:
 addin classAbstractCollectionDecorator
 
- 
addAll
public boolean addAll(java.util.Collection coll)
- Specified by:
 addAllin interfacejava.util.Collection- Overrides:
 addAllin classAbstractCollectionDecorator
 
- 
clear
public void clear()
- Specified by:
 clearin interfacejava.util.Collection- Overrides:
 clearin classAbstractCollectionDecorator
 
- 
remove
public boolean remove(java.lang.Object object)
- Specified by:
 removein interfacejava.util.Collection- Overrides:
 removein classAbstractCollectionDecorator
 
- 
removeAll
public boolean removeAll(java.util.Collection coll)
- Specified by:
 removeAllin interfacejava.util.Collection- Overrides:
 removeAllin classAbstractCollectionDecorator
 
- 
retainAll
public boolean retainAll(java.util.Collection coll)
- Specified by:
 retainAllin interfacejava.util.Collection- Overrides:
 retainAllin classAbstractCollectionDecorator
 
- 
isFull
public boolean isFull()
Description copied from interface:BoundedCollectionReturns true if this collection is full and no new elements can be added.- Specified by:
 isFullin interfaceBoundedCollection- Returns:
 trueif the collection is full
 
- 
maxSize
public int maxSize()
Description copied from interface:BoundedCollectionGets the maximum size of the collection (the bound).- Specified by:
 maxSizein interfaceBoundedCollection- Returns:
 - the maximum number of elements the collection can hold
 
 
 - 
 
 -