org.jboss.cache.util
Class MapCopy<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.jboss.cache.util.MapCopy<K,V>
- All Implemented Interfaces:
- Serializable, Map<K,V>
@Immutable
public class MapCopy<K,V>
- extends AbstractMap<K,V>
- implements 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
UnsupportedOperationException
s.
- Author:
- Elias Ross
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Constructor Summary |
MapCopy()
|
MapCopy(Map<K,V> m)
Copies the supplied map to an internal array. |
Methods inherited from class java.util.AbstractMap |
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, toString, values |
MapCopy
public MapCopy(Map<K,V> m)
- Copies the supplied map to an internal array.
- Parameters:
m
- map to copy
MapCopy
public MapCopy()
copy
public static <L,W> Map<L,W> copy(Map<L,W> m)
- Returns a copy of the given map.
entrySet
public Set<Map.Entry<K,V>> entrySet()
- Specified by:
entrySet
in interface Map<K,V>
- Specified by:
entrySet
in class AbstractMap<K,V>
size
public int size()
- Specified by:
size
in interface Map<K,V>
- Overrides:
size
in class AbstractMap<K,V>
Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.