|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.collection.AbstractCollectionDecorator<E> net.sf.collections15.collection.AbstractSerializableCollectionDecorator<E> net.sf.collections15.collection.UnmodifiableBoundedCollection<E>
public final class UnmodifiableBoundedCollection<E>
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.
Field Summary |
---|
Fields inherited from class net.sf.collections15.collection.AbstractCollectionDecorator |
---|
collection |
Method Summary | ||
---|---|---|
boolean |
add(E object)
|
|
boolean |
addAll(java.util.Collection<? extends E> coll)
|
|
void |
clear()
|
|
static
|
decorate(BoundedCollection<T> coll)
Factory method to create an unmodifiable bounded collection. |
|
static
|
decorateUsing(java.util.Collection<T> 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. |
|
java.util.Iterator<E> |
iterator()
|
|
int |
maxSize()
Gets the maximum size of the collection (the bound). |
|
boolean |
remove(java.lang.Object object)
|
|
boolean |
removeAll(java.util.Collection<?> coll)
|
|
boolean |
retainAll(java.util.Collection<?> coll)
|
Methods inherited from class net.sf.collections15.collection.AbstractCollectionDecorator |
---|
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray |
Method Detail |
---|
public static <T> BoundedCollection<T> decorate(BoundedCollection<T> coll)
coll
- the BoundedCollection
to decorate, must not be null
java.lang.IllegalArgumentException
- if bag is nullpublic static <T> BoundedCollection<T> decorateUsing(java.util.Collection<T> 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 null
java.lang.IllegalArgumentException
- if bag is nullpublic java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in class AbstractCollectionDecorator<E>
public boolean add(E object)
add
in interface java.util.Collection<E>
add
in class AbstractCollectionDecorator<E>
public boolean addAll(java.util.Collection<? extends E> coll)
addAll
in interface java.util.Collection<E>
addAll
in class AbstractCollectionDecorator<E>
public void clear()
clear
in interface java.util.Collection<E>
clear
in class AbstractCollectionDecorator<E>
public boolean remove(java.lang.Object object)
remove
in interface java.util.Collection<E>
remove
in class AbstractCollectionDecorator<E>
public boolean removeAll(java.util.Collection<?> coll)
removeAll
in interface java.util.Collection<E>
removeAll
in class AbstractCollectionDecorator<E>
public boolean retainAll(java.util.Collection<?> coll)
retainAll
in interface java.util.Collection<E>
retainAll
in class AbstractCollectionDecorator<E>
public boolean isFull()
BoundedCollection
isFull
in interface BoundedCollection<E>
true
if the collection is fullpublic int maxSize()
BoundedCollection
maxSize
in interface BoundedCollection<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |