public final class UnmodifiableBoundedCollection extends AbstractSerializableCollectionDecorator implements BoundedCollection
UnmodifiableBoundedCollection decorates another
BoundedCollection to 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.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object object) |
boolean |
addAll(java.util.Collection coll) |
void |
clear() |
static BoundedCollection |
decorate(BoundedCollection coll)
Factory method to create an unmodifiable bounded collection.
|
static BoundedCollection |
decorateUsing(java.util.Collection coll)
Factory method to create an unmodifiable bounded collection.
|
boolean |
isFull()
Returns true if this collection is full and no new elements can be added.
|
java.util.Iterator |
iterator() |
int |
maxSize()
Gets the maximum size of the collection (the bound).
|
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection coll) |
boolean |
retainAll(java.util.Collection coll) |
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray, toStringpublic static BoundedCollection decorate(BoundedCollection coll)
coll - the BoundedCollection to decorate, must not be nulljava.lang.IllegalArgumentException - if bag is nullpublic static BoundedCollection decorateUsing(java.util.Collection coll)
This method is capable of drilling down through up to 1000 other decorators to find a suitable BoundedCollection.
coll - the BoundedCollection to decorate, must not be nulljava.lang.IllegalArgumentException - if bag is nullpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in class AbstractCollectionDecoratorpublic boolean add(java.lang.Object object)
add in interface java.util.Collectionadd in class AbstractCollectionDecoratorpublic boolean addAll(java.util.Collection coll)
addAll in interface java.util.CollectionaddAll in class AbstractCollectionDecoratorpublic void clear()
clear in interface java.util.Collectionclear in class AbstractCollectionDecoratorpublic boolean remove(java.lang.Object object)
remove in interface java.util.Collectionremove in class AbstractCollectionDecoratorpublic boolean removeAll(java.util.Collection coll)
removeAll in interface java.util.CollectionremoveAll in class AbstractCollectionDecoratorpublic boolean retainAll(java.util.Collection coll)
retainAll in interface java.util.CollectionretainAll in class AbstractCollectionDecoratorpublic boolean isFull()
BoundedCollectionisFull in interface BoundedCollectiontrue if the collection is fullpublic int maxSize()
BoundedCollectionmaxSize in interface BoundedCollectionCopyright © 2010 - 2023 Adobe. All Rights Reserved