it.unimi.dsi.fastutil.objects
Interface Reference2LongMap

All Superinterfaces:
Map
All Known Subinterfaces:
Reference2LongSortedMap
All Known Implementing Classes:
AbstractReference2LongMap, Reference2LongLinkedOpenHashMap, Reference2LongOpenHashMap

public interface Reference2LongMap
extends Map

A type-specific Map; provides some additional methods that use polymorphism to reduce type juggling.

See Also:
Map

Nested Class Summary
static interface Reference2LongMap.Entry
          A type-specific Map.Entry; provides some additional methods to access its content reducing type juggling.
 
Method Summary
 boolean containsValue(long value)
           
 long defaultReturnValue()
          Gets the default return value.
 void defaultReturnValue(long rv)
          Sets the default return value.
 long getDefRetValue()
          Deprecated. As of fastutil 2.0, replaced by defaultReturnValue().
 long getLong(Object key)
          Returns the value to which the given key is mapped.
 long put(Object key, long value)
          Adds a pair to the map.
 long removeLong(Object key)
          Removes the mapping with the given key.
 void setDefRetValue(long rv)
          Deprecated. As of fastutil 2.0, replaced by defaultReturnValue().
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

put

public long put(Object key,
                long value)
Adds a pair to the map.

Parameters:
key - the key.
value - the value.
Returns:
the old value, or the default return value if no value was present for the given key.
See Also:
Map.put(Object,Object)

getLong

public long getLong(Object key)
Returns the value to which the given key is mapped.

Parameters:
key - the key.
Returns:
the corresponding value, or the default return value if no value was present for the given key.
See Also:
Map.get(Object)

removeLong

public long removeLong(Object key)
Removes the mapping with the given key.

Parameters:
key -
Returns:
the old value, or the default return value if no value was present for the given key.
See Also:
Map.remove(Object)

containsValue

public boolean containsValue(long value)
See Also:
Map.containsValue(Object)

setDefRetValue

public void setDefRetValue(long rv)
Deprecated. As of fastutil 2.0, replaced by defaultReturnValue().

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.

Parameters:
rv - the new default return value.
See Also:
getDefRetValue(), defaultReturnValue()

getDefRetValue

public long getDefRetValue()
Deprecated. As of fastutil 2.0, replaced by defaultReturnValue().

Gets the default return value.

Returns:
the current default return value.
See Also:
defaultReturnValue()

defaultReturnValue

public void defaultReturnValue(long rv)
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.

Parameters:
rv - the new default return value.
See Also:
defaultReturnValue()

defaultReturnValue

public long defaultReturnValue()
Gets the default return value.

Returns:
the current default return value.