harpoon.Analysis.PointerAnalysis
Class LightMap<K,V>

java.lang.Object
  extended by harpoon.Analysis.PointerAnalysis.LightMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class LightMap<K,V>
extends Object
implements Map<K,V>, Cloneable, Serializable

LightMap is a very lightweight implementation of the java.util.Map interface.

Version:
$Id: LightMap.java,v 1.2 2005/11/30 22:25:56 salcianu Exp $
Author:
Alexandru SALCIANU <salcianu@alum.mit.edu>
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
LightMap()
          Creates a LightMap.
LightMap(Map<? extends K,? extends V> map)
          Creates a LightMap with the same mappings as the given map.
 
Method Summary
 void clear()
           
 Object clone()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
          Unsupported yet.
 Set<Map.Entry<K,V>> entrySet()
          Returns an unmodifiable set view of the map entries.
 boolean equals(Object o)
           
 V get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<K> keySet()
          Returns an unmodifiable set view of the keys contained in this map.
 V put(K key, V value)
          Associates the specified value with the specified key in this map.
 void putAll(Map<? extends K,? extends V> map)
          Copies all of the mappings from the specified map to this map.
 V remove(Object key)
          Removes the mapping previously attached to key.
 int size()
           
 String toString()
           
 Collection<V> values()
          Returns an unmodifiable collection view of the values from this map.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LightMap

public LightMap()
Creates a LightMap.


LightMap

public LightMap(Map<? extends K,? extends V> map)
Creates a LightMap with the same mappings as the given map.

Method Detail

size

public final int size()
Specified by:
size in interface Map<K,V>

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface Map<K,V>

containsKey

public final boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>

containsValue

public final boolean containsValue(Object value)
Unsupported yet.

Specified by:
containsValue in interface Map<K,V>

get

public V get(Object key)
Specified by:
get in interface Map<K,V>

put

public final V put(K key,
                   V value)
Associates the specified value with the specified key in this map.

Specified by:
put in interface Map<K,V>

remove

public final V remove(Object key)
Removes the mapping previously attached to key. Returns the old mapping if any, or null otherwise.

Specified by:
remove in interface Map<K,V>

putAll

public final void putAll(Map<? extends K,? extends V> map)
Copies all of the mappings from the specified map to this map.

Specified by:
putAll in interface Map<K,V>

clear

public final void clear()
Specified by:
clear in interface Map<K,V>

values

public final Collection<V> values()
Returns an unmodifiable collection view of the values from this map.

Specified by:
values in interface Map<K,V>

entrySet

public final Set<Map.Entry<K,V>> entrySet()
Returns an unmodifiable set view of the map entries.

Specified by:
entrySet in interface Map<K,V>

keySet

public final Set<K> keySet()
Returns an unmodifiable set view of the keys contained in this map.

Specified by:
keySet in interface Map<K,V>

clone

public Object clone()
Overrides:
clone in class Object

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<K,V>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<K,V>
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object