⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.collection

Class UnmodifiableBoundedCollection

java.lang.Object
|
+--org.apache.commons.collections.collection.AbstractCollectionDecorator
   |
   +--org.apache.commons.collections.collection.UnmodifiableBoundedCollection

All Implemented Interfaces:
Collection, BoundedCollection


public final class UnmodifiableBoundedCollection
extends AbstractCollectionDecorator
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 nature is lost. The factory on this class will attempt to retrieve the bounded nature by examining the package scope variables.

Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Method Summary

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()

Iterator

iterator()

int

maxSize()

boolean

remove(Object object)

boolean

removeAll(Collection coll)

boolean

retainAll(Collection coll)

Method Details

add

public boolean add(Object object)

Parameters:
object

addAll

public boolean addAll(Collection coll)

Parameters:
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
Throws:
- 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
Throws:
- if bag is null

isFull

public boolean isFull()


iterator

public Iterator iterator()


maxSize

public int maxSize()


remove

public boolean remove(Object object)

Parameters:
object

removeAll

public boolean removeAll(Collection coll)

Parameters:
coll

retainAll

public boolean retainAll(Collection coll)

Parameters:
coll