com.go.trove.util
Class NullKeyMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--com.go.trove.util.NullKeyMap
All Implemented Interfaces:
java.util.Map, java.io.Serializable

public class NullKeyMap
extends java.util.AbstractMap
implements java.io.Serializable

A Map supporting null keys that wraps a Map that doesn't support null keys. NullKeyMap substitutes null keys with a special placeholder object. This technique does not work when the wrapped Map is a TreeMap because it cannot be compared against other objects. In order for TreeMaps to support null keys, use any of the null ordering comparators found in the Utils class.

Version:
9 , 9/07/00
Author:
Brian S O'Neill
See Also:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
NullKeyMap(java.util.Map map)
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map map)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullKeyMap

public NullKeyMap(java.util.Map map)
Parameters:
map - The map to wrap.
Method Detail

size

public int size()
Overrides:
size in class java.util.AbstractMap

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class java.util.AbstractMap

containsKey

public boolean containsKey(java.lang.Object key)
Overrides:
containsKey in class java.util.AbstractMap

containsValue

public boolean containsValue(java.lang.Object value)
Overrides:
containsValue in class java.util.AbstractMap

get

public java.lang.Object get(java.lang.Object key)
Overrides:
get in class java.util.AbstractMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Overrides:
put in class java.util.AbstractMap

remove

public java.lang.Object remove(java.lang.Object key)
Overrides:
remove in class java.util.AbstractMap

putAll

public void putAll(java.util.Map map)
Overrides:
putAll in class java.util.AbstractMap

clear

public void clear()
Overrides:
clear in class java.util.AbstractMap

keySet

public java.util.Set keySet()
Overrides:
keySet in class java.util.AbstractMap

values

public java.util.Collection values()
Overrides:
values in class java.util.AbstractMap

entrySet

public java.util.Set entrySet()
Overrides:
entrySet in class java.util.AbstractMap