org.jboss.cache.util
Class MapCopy<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by org.jboss.cache.util.MapCopy<K,V>
All Implemented Interfaces:
java.io.Serializable, java.util.Map<K,V>

public class MapCopy<K,V>
extends java.util.AbstractMap<K,V>
implements java.io.Serializable

Contains a fixed array of read-only map entries, from a copy of an existing map. This class is more lightweight for places where the copied map will just be iterated over.

This map is strictly read-only, and map modification methods (as well as modifications over iterators) will throw UnsupportedOperationExceptions.

Author:
Elias Ross
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MapCopy()
           
MapCopy(java.util.Map<K,V> m)
          Copies the supplied map to an internal array.
 
Method Summary
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
           
 int size()
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapCopy

public MapCopy(java.util.Map<K,V> m)
Copies the supplied map to an internal array.

Parameters:
m - map to copy

MapCopy

public MapCopy()
Method Detail

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface java.util.Map<K,V>
Specified by:
entrySet in class java.util.AbstractMap<K,V>

size

public int size()
Specified by:
size in interface java.util.Map<K,V>
Overrides:
size in class java.util.AbstractMap<K,V>