JUtil

net.cscott.jutil
Class UnmodifiableMapSet<K,V>

java.lang.Object
  extended by net.cscott.jutil.CollectionWrapper<E>
      extended by net.cscott.jutil.SetWrapper<Map.Entry<K,V>>
          extended by net.cscott.jutil.UnmodifiableMapSet<K,V>
All Implemented Interfaces:
Iterable<Map.Entry<K,V>>, Collection<Map.Entry<K,V>>, Set<Map.Entry<K,V>>, MapSet<K,V>
Direct Known Subclasses:
UnmodifiableMultiMapSet

public abstract class UnmodifiableMapSet<K,V>
extends SetWrapper<Map.Entry<K,V>>

UnmodifiableMapSet prevents mutation of a wrapped MapSet.

Version:
$Id: UnmodifiableMapSet.java,v 1.1 2006-10-29 20:15:47 cananian Exp $
Author:
C. Scott Ananian

Constructor Summary
protected UnmodifiableMapSet()
           
 
Method Summary
 boolean add(Map.Entry<K,V> o)
           
 boolean addAll(Collection<? extends Map.Entry<K,V>> c)
           
abstract  UnmodifiableMap<K,V> asMap()
           
 void clear()
           
 Iterator<Map.Entry<K,V>> iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
protected abstract  MapSet<K,V> wrapped()
          Implementations should return the wrapped MapSet here.
 
Methods inherited from class net.cscott.jutil.CollectionWrapper
contains, containsAll, equals, 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.Set
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray
 

Constructor Detail

UnmodifiableMapSet

protected UnmodifiableMapSet()
Method Detail

wrapped

protected abstract MapSet<K,V> wrapped()
Implementations should return the wrapped MapSet here.

Specified by:
wrapped in class SetWrapper<Map.Entry<K,V>>

asMap

public abstract UnmodifiableMap<K,V> asMap()

iterator

public Iterator<Map.Entry<K,V>> iterator()
Specified by:
iterator in interface Iterable<Map.Entry<K,V>>
Specified by:
iterator in interface Collection<Map.Entry<K,V>>
Specified by:
iterator in interface Set<Map.Entry<K,V>>
Overrides:
iterator in class CollectionWrapper<Map.Entry<K,V>>

add

public boolean add(Map.Entry<K,V> o)
Specified by:
add in interface Collection<Map.Entry<K,V>>
Specified by:
add in interface Set<Map.Entry<K,V>>
Overrides:
add in class CollectionWrapper<Map.Entry<K,V>>

addAll

public boolean addAll(Collection<? extends Map.Entry<K,V>> c)
Specified by:
addAll in interface Collection<Map.Entry<K,V>>
Specified by:
addAll in interface Set<Map.Entry<K,V>>
Overrides:
addAll in class CollectionWrapper<Map.Entry<K,V>>

clear

public void clear()
Specified by:
clear in interface Collection<Map.Entry<K,V>>
Specified by:
clear in interface Set<Map.Entry<K,V>>
Overrides:
clear in class CollectionWrapper<Map.Entry<K,V>>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Map.Entry<K,V>>
Specified by:
remove in interface Set<Map.Entry<K,V>>
Overrides:
remove in class CollectionWrapper<Map.Entry<K,V>>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Map.Entry<K,V>>
Specified by:
removeAll in interface Set<Map.Entry<K,V>>
Overrides:
removeAll in class CollectionWrapper<Map.Entry<K,V>>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Map.Entry<K,V>>
Specified by:
retainAll in interface Set<Map.Entry<K,V>>
Overrides:
retainAll in class CollectionWrapper<Map.Entry<K,V>>

JUtil

Copyright (c) 2006 C. Scott Ananian