org.apache.commons.collections.collection

Class UnmodifiableBoundedCollection

Implemented Interfaces:
BoundedCollection, Collection, Serializable

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.

Version:
$Revision: 1.10 $ $Date: 2004/06/03 22:02:13 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Field Summary

Fields inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator

collection

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)

Methods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator

add, addAll, clear, contains, containsAll, equals, getCollection, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString

Method Details

add

public boolean add(Object object)
Overrides:
add in interface AbstractCollectionDecorator

addAll

public boolean addAll(Collection coll)
Overrides:
addAll in interface AbstractCollectionDecorator

clear

public void clear()
Overrides:
clear in interface AbstractCollectionDecorator

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

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

isFull

public boolean isFull()
Specified by:
isFull in interface BoundedCollection

iterator

public Iterator iterator()
Overrides:
iterator in interface AbstractCollectionDecorator

maxSize

public int maxSize()
Specified by:
maxSize in interface BoundedCollection

remove

public boolean remove(Object object)
Overrides:
remove in interface AbstractCollectionDecorator

removeAll

public boolean removeAll(Collection coll)
Overrides:
removeAll in interface AbstractCollectionDecorator

retainAll

public boolean retainAll(Collection coll)
Overrides:
retainAll in interface AbstractCollectionDecorator

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.