org.apache.commons.collections.collection

Class UnmodifiableBoundedCollection

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.

Since: Commons Collections 3.0

Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $

Author: Stephen Colebourne

Method Summary
booleanadd(Object object)
booleanaddAll(Collection coll)
voidclear()
static BoundedCollectiondecorate(BoundedCollection coll)
Factory method to create an unmodifiable bounded collection.
static BoundedCollectiondecorateUsing(Collection coll)
Factory method to create an unmodifiable bounded collection.
booleanisFull()
Iteratoriterator()
intmaxSize()
booleanremove(Object object)
booleanremoveAll(Collection coll)
booleanretainAll(Collection coll)

Method Detail

add

public boolean add(Object object)

addAll

public boolean addAll(Collection coll)

clear

public void clear()

decorate

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

decorateUsing

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

isFull

public boolean isFull()

iterator

public Iterator iterator()

maxSize

public int maxSize()

remove

public boolean remove(Object object)

removeAll

public boolean removeAll(Collection coll)

retainAll

public boolean retainAll(Collection coll)
Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.