org.apache.commons.collections.map
Class UnmodifiableEntrySet<K,V>

java.lang.Object
  extended by org.apache.commons.collections.collection.AbstractCollectionDecorator<E>
      extended by org.apache.commons.collections.set.AbstractSetDecorator<Map.Entry<K,V>>
          extended by org.apache.commons.collections.map.UnmodifiableEntrySet<K,V>
All Implemented Interfaces:
Iterable<Map.Entry<K,V>>, Collection<Map.Entry<K,V>>, Set<Map.Entry<K,V>>, Unmodifiable

public final class UnmodifiableEntrySet<K,V>
extends AbstractSetDecorator<Map.Entry<K,V>>
implements Unmodifiable

Decorates a map entry Set to ensure it can't be altered.

Since:
Commons Collections 3.0
Version:
$Revision: 1.1.1.1 $ $Date: 2005/05/23 04:36:14 $
Author:
Matt Hall, John Watkinson, Stephen Colebourne

Field Summary
 
Fields inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator
collection
 
Method Summary
 boolean add(Map.Entry<K,V> object)
           
 boolean addAll(Collection<? extends Map.Entry<K,V>> coll)
           
 void clear()
           
static
<K,V> Set<Map.Entry<K,V>>
decorate(Set<Map.Entry<K,V>> set)
          Factory method to create an unmodifiable set of Map Entry objects.
 Iterator<Map.Entry<K,V>> iterator()
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> coll)
           
 boolean retainAll(Collection<?> coll)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] array)
           
 
Methods inherited from class org.apache.commons.collections.set.AbstractSetDecorator
getSet
 
Methods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator
contains, containsAll, equals, getCollection, hashCode, isEmpty, size, 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
 

Method Detail

decorate

public static <K,V> Set<Map.Entry<K,V>> decorate(Set<Map.Entry<K,V>> set)
Factory method to create an unmodifiable set of Map Entry objects.

Parameters:
set - the set to decorate, must not be null
Throws:
IllegalArgumentException - if set is null

add

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

addAll

public boolean addAll(Collection<? extends Map.Entry<K,V>> coll)
Specified by:
addAll in interface Collection<Map.Entry<K,V>>
Specified by:
addAll in interface Set<Map.Entry<K,V>>
Overrides:
addAll in class AbstractCollectionDecorator<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 AbstractCollectionDecorator<Map.Entry<K,V>>

remove

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

removeAll

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

retainAll

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

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 AbstractCollectionDecorator<Map.Entry<K,V>>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Map.Entry<K,V>>
Specified by:
toArray in interface Set<Map.Entry<K,V>>
Overrides:
toArray in class AbstractCollectionDecorator<Map.Entry<K,V>>

toArray

public <T> T[] toArray(T[] array)
Specified by:
toArray in interface Collection<Map.Entry<K,V>>
Specified by:
toArray in interface Set<Map.Entry<K,V>>
Overrides:
toArray in class AbstractCollectionDecorator<Map.Entry<K,V>>


Copyright © 2005-2005 Apache Software Foundation, Matt Hall, John Watkinson. All Rights Reserved.