net.sf.molae.pipe.basic
Class UnextendableCollection<E>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<B>
      extended by net.sf.molae.pipe.basic.CollectionProxy<Collection<E>,E>
          extended by net.sf.molae.pipe.basic.UnextendableCollection<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>

public final class UnextendableCollection<E>
extends CollectionProxy<Collection<E>,E>

A wrapper around collections that prohibits adding elements. Useful for map implementations.


Constructor Summary
UnextendableCollection(Collection<E> base)
          Constructs an UnextendableCollection object.
 
Method Summary
 boolean add(E o)
          This implementation always throws an UnsupportedOperationException.
 boolean addAll(Collection<? extends E> c)
          This implementation always throws an UnsupportedOperationException.
 
Methods inherited from class net.sf.molae.pipe.basic.CollectionProxy
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, equals, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

UnextendableCollection

public UnextendableCollection(Collection<E> base)
Constructs an UnextendableCollection object.

Parameters:
base - the underlying (extendable) collection
Throws:
NullPointerException - if the specified object is null.
Method Detail

add

public boolean add(E o)
This implementation always throws an UnsupportedOperationException.

Specified by:
add in interface Collection<E>
Overrides:
add in class CollectionProxy<Collection<E>,E>

addAll

public boolean addAll(Collection<? extends E> c)
This implementation always throws an UnsupportedOperationException.

Specified by:
addAll in interface Collection<E>
Overrides:
addAll in class CollectionProxy<Collection<E>,E>