public final class

UnmodifiableBoundedCollection

extends AbstractSerializableCollectionDecorator
implements BoundedCollection
java.lang.Object
   ↳ org.apache.commons.collections.collection.AbstractCollectionDecorator
     ↳ org.apache.commons.collections.collection.AbstractSerializableCollectionDecorator
       ↳ org.apache.commons.collections.collection.UnmodifiableBoundedCollection

Class Overview

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.

Summary

[Expand]
Inherited Fields
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
Public Methods
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)
[Expand]
Inherited Methods
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface org.apache.commons.collections.BoundedCollection

Public Methods

public boolean add (Object object)

public boolean addAll (Collection coll)

public void clear ()

public static BoundedCollection decorate (BoundedCollection coll)

Factory method to create an unmodifiable bounded collection.

Parameters
coll the BoundedCollection to decorate, must not be null
Returns
  • a new unmodifiable bounded collection
Throws
IllegalArgumentException if bag is null

public static BoundedCollection decorateUsing (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 the BoundedCollection to decorate, must not be null
Returns
  • a new unmodifiable bounded collection
Throws
IllegalArgumentException if bag is null

public boolean isFull ()

Returns true if this collection is full and no new elements can be added.

Returns
  • true if the collection is full

public Iterator iterator ()

public int maxSize ()

Gets the maximum size of the collection (the bound).

Returns
  • the maximum number of elements the collection can hold

public boolean remove (Object object)

public boolean removeAll (Collection coll)

public boolean retainAll (Collection coll)