repthy
Class ImmutableSet

Object
  extended byAbstractCollection
      extended byAbstractSet
          extended byImmutableSet
All Implemented Interfaces:
Collection, Set
Direct Known Subclasses:
Group, SingletonSortedSet

public abstract class ImmutableSet
extends AbstractSet

A Set that can't be modified once it's been created.

Author:
Mark McConnell

Constructor Summary
ImmutableSet()
           
 
Method Summary
 boolean add(Object o)
          Unsupported, because this set is immutable.
 boolean addAll(Collection c)
          Unsupported, because this set is immutable.
 void clear()
          Unsupported, because this set is immutable.
 boolean remove(Object o)
          Unsupported, because this set is immutable.
 boolean removeAll(Collection c)
          Unsupported, because this set is immutable.
 boolean retainAll(Collection c)
          Unsupported, because this set is immutable.
 
Methods inherited from class AbstractSet
equals, hashCode
 
Methods inherited from class AbstractCollection
contains, containsAll, isEmpty, iterator, size, toArray, toArray, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Set
contains, containsAll, isEmpty, iterator, size, toArray, toArray
 

Constructor Detail

ImmutableSet

public ImmutableSet()
Method Detail

add

public final boolean add(Object o)
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.

addAll

public final boolean addAll(Collection c)
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.

clear

public final void clear()
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.

remove

public final boolean remove(Object o)
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.

removeAll

public final boolean removeAll(Collection c)
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.

retainAll

public final boolean retainAll(Collection c)
Unsupported, because this set is immutable.

Throws:
UnsupportedOperationException - Always.