it.unimi.dsi.fastutil
Class Maps

java.lang.Object
  extended byit.unimi.dsi.fastutil.Maps

public class Maps
extends Object

A class providing static methods and objects that do useful things with maps.

See Also:
Collections

Field Summary
static Object MISSING
          A standard default return value to be used in maps contaning null values.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MISSING

public static final Object MISSING
A standard default return value to be used in maps contaning null values.

Maps with object values containing null values are usually problematic because there is no way to tell whether get(), put() and remove() did not find a key or the key was found but the associated value is null. This object can be used as a default return value to solve this problem:

 m = new Object2ObjectAVLTreeMap();
 m.defaultReturnValue(MISSING);
 [...]
 v = m.get(k);
 if (MISSING == v) ... // not found
 else ... // found