it.unimi.dsi.fastutil.objects
Class AbstractObject2ReferenceMap

java.lang.Object
  extended byit.unimi.dsi.fastutil.objects.AbstractObject2ReferenceMap
All Implemented Interfaces:
Map, Object2ReferenceMap, Serializable
Direct Known Subclasses:
Object2ReferenceAVLTreeMap, Object2ReferenceLinkedOpenHashMap, Object2ReferenceOpenHashMap, Object2ReferenceRBTreeMap

public abstract class AbstractObject2ReferenceMap
extends Object
implements Object2ReferenceMap, Serializable

An abstract class providing basic methods for maps implementing a type-specific interface.

In particular, this class provide Map.containsKey(Object) and Map.containsValue(Object) methods that just call the type-specific counterpart.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.objects.Object2ReferenceMap
Object2ReferenceMap.Entry
 
Method Summary
 Object defaultReturnValue()
          Gets the default return value.
 void defaultReturnValue(Object rv)
          Sets the default return value.
 boolean equals(Object o)
           
 Object getDefRetValue()
          Gets the default return value.
 int hashCode()
          Returns a hash code for this map.
 void putAll(Map m)
          Puts all pairs in the given map.
 void setDefRetValue(Object rv)
          Sets the default return value.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, remove, size, values
 

Method Detail

setDefRetValue

public void setDefRetValue(Object rv)
Description copied from interface: Object2ReferenceMap
Sets the default return value. This value is returned by get(), put() and remove() to denote that the map does not contain the specified key. It is 0/false/null by default.

Specified by:
setDefRetValue in interface Object2ReferenceMap
Parameters:
rv - the new default return value.
See Also:
Object2ReferenceMap.getDefRetValue(), Object2ReferenceMap.defaultReturnValue()

getDefRetValue

public Object getDefRetValue()
Description copied from interface: Object2ReferenceMap
Gets the default return value.

Specified by:
getDefRetValue in interface Object2ReferenceMap
Returns:
the current default return value.
See Also:
Object2ReferenceMap.defaultReturnValue()

defaultReturnValue

public void defaultReturnValue(Object rv)
Description copied from interface: Object2ReferenceMap
Sets the default return value. This value is returned by get(), put() and remove() to denote that the map does not contain the specified key. It is 0/false/null by default.

Specified by:
defaultReturnValue in interface Object2ReferenceMap
Parameters:
rv - the new default return value.
See Also:
Object2ReferenceMap.defaultReturnValue()

defaultReturnValue

public Object defaultReturnValue()
Description copied from interface: Object2ReferenceMap
Gets the default return value.

Specified by:
defaultReturnValue in interface Object2ReferenceMap
Returns:
the current default return value.

putAll

public void putAll(Map m)
Puts all pairs in the given map. If the map implements the interface of this map, it uses the faster iterators.

Specified by:
putAll in interface Map
Parameters:
m - a map.

hashCode

public int hashCode()
Returns a hash code for this map. The hash code of a map is computed by summing the hash codes of its entries.

Specified by:
hashCode in interface Map
Returns:
a hash code for this map.

equals

public boolean equals(Object o)
Specified by:
equals in interface Map

toString

public String toString()