public final class UnmodifiableBuffer<E> extends AbstractBufferDecorator<E> implements Unmodifiable, Serializable
Buffer to ensure it can't be altered.
This class is Serializable from Commons Collections 3.1.
Attempts to modify it will result in an UnsupportedOperationException.
collection| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object object) |
boolean |
addAll(Collection<? extends E> coll) |
void |
clear() |
Iterator<E> |
iterator() |
E |
remove()
Gets and removes the next object from the buffer.
|
boolean |
remove(Object object) |
boolean |
removeAll(Collection<?> coll) |
boolean |
retainAll(Collection<?> coll) |
static <E> Buffer<E> |
unmodifiableBuffer(Buffer<E> buffer)
Factory method to create an unmodifiable buffer.
|
decorated, getcontains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, size, toArray, toArraypublic static <E> Buffer<E> unmodifiableBuffer(Buffer<E> buffer)
If the buffer passed in is already unmodifiable, it is returned.
E - the type of the elements in the bufferbuffer - the buffer to decorate, must not be nullIllegalArgumentException - if buffer is nullpublic Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in class AbstractCollectionDecorator<E>public boolean add(Object object)
add in interface Collection<E>add in class AbstractCollectionDecorator<E>public boolean addAll(Collection<? extends E> coll)
addAll in interface Collection<E>addAll in class AbstractCollectionDecorator<E>public void clear()
clear in interface Collection<E>clear in class AbstractCollectionDecorator<E>public boolean remove(Object object)
remove in interface Collection<E>remove in class AbstractCollectionDecorator<E>public boolean removeAll(Collection<?> coll)
removeAll in interface Collection<E>removeAll in class AbstractCollectionDecorator<E>public boolean retainAll(Collection<?> coll)
retainAll in interface Collection<E>retainAll in class AbstractCollectionDecorator<E>Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.