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.
collection
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object object) |
boolean |
addAll(Collection coll) |
void |
clear() |
static BoundedCollection |
decorate(BoundedCollection coll)
Factory method to create an unmodifiable bounded collection.
|
static BoundedCollection |
decorateUsing(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.
|
Iterator |
iterator() |
int |
maxSize()
Gets the maximum size of the collection (the bound).
|
boolean |
remove(Object object) |
boolean |
removeAll(Collection coll) |
boolean |
retainAll(Collection coll) |
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
public static BoundedCollection decorate(BoundedCollection coll)
coll
- the BoundedCollection
to decorate, must not be nullIllegalArgumentException
- if bag is nullpublic static BoundedCollection decorateUsing(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 nullIllegalArgumentException
- if bag is nullpublic Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in class AbstractCollectionDecorator
public boolean add(Object object)
add
in interface Collection
add
in class AbstractCollectionDecorator
public boolean addAll(Collection coll)
addAll
in interface Collection
addAll
in class AbstractCollectionDecorator
public void clear()
clear
in interface Collection
clear
in class AbstractCollectionDecorator
public boolean remove(Object object)
remove
in interface Collection
remove
in class AbstractCollectionDecorator
public boolean removeAll(Collection coll)
removeAll
in interface Collection
removeAll
in class AbstractCollectionDecorator
public boolean retainAll(Collection coll)
retainAll
in interface Collection
retainAll
in class AbstractCollectionDecorator
public boolean isFull()
BoundedCollection
isFull
in interface BoundedCollection
true
if the collection is fullpublic int maxSize()
BoundedCollection
maxSize
in interface BoundedCollection
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.