it.unimi.dsi.fastutil.bytes
Class Byte2IntMaps.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.bytes.AbstractByte2IntMap
      extended byit.unimi.dsi.fastutil.bytes.Byte2IntMaps.Singleton
All Implemented Interfaces:
Byte2IntMap, Cloneable, Map, Serializable
Direct Known Subclasses:
Byte2IntSortedMaps.Singleton
Enclosing class:
Byte2IntMaps

public static class Byte2IntMaps.Singleton
extends AbstractByte2IntMap
implements Serializable, Cloneable

An immutable class representing a type-specific singleton map.

This class may be useful to implement your own in case you subclass a type-specific map.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class it.unimi.dsi.fastutil.bytes.AbstractByte2IntMap
AbstractByte2IntMap.BasicEntry
 
Nested classes inherited from class it.unimi.dsi.fastutil.bytes.Byte2IntMap
Byte2IntMap.Entry
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 Object clone()
           
 boolean containsKey(byte k)
          Checks whether the given value is contained in keySet().
 boolean containsValue(int v)
          Checks whether the given value is contained in values().
 Set entrySet()
           
 int get(byte k)
          Returns the value to which the given key is mapped.
 Set keySet()
          Returns a type-specific-set view of the keys of this map.
 void putAll(Map m)
          Puts all pairs in the given map.
 int size()
           
 Collection values()
          Returns a type-specific-set view of the values of this map.
 
Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByte2IntMap
clear, containsKey, containsValue, defaultReturnValue, defaultReturnValue, equals, get, getDefRetValue, hashCode, isEmpty, put, put, remove, remove, setDefRetValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

containsKey

public boolean containsKey(byte k)
Description copied from class: AbstractByte2IntMap
Checks whether the given value is contained in AbstractByte2IntMap.keySet().

Specified by:
containsKey in interface Byte2IntMap
Overrides:
containsKey in class AbstractByte2IntMap

containsValue

public boolean containsValue(int v)
Description copied from class: AbstractByte2IntMap
Checks whether the given value is contained in AbstractByte2IntMap.values().

Specified by:
containsValue in interface Byte2IntMap
Overrides:
containsValue in class AbstractByte2IntMap

putAll

public void putAll(Map m)
Description copied from class: AbstractByte2IntMap
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
Overrides:
putAll in class AbstractByte2IntMap
Parameters:
m - a map.

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map

keySet

public Set keySet()
Description copied from class: AbstractByte2IntMap
Returns a type-specific-set view of the keys of this map.

The view is backed by the set returned by Map.entrySet(). Note that no attempt is made at caching the result of this method, as this would require adding some attributes that lightweight implementations would not need. Subclasses may easily override this policy by calling this method and caching the result, but implementors are encouraged to write more efficient ad-hoc implementations.

Specified by:
keySet in interface Map
Overrides:
keySet in class AbstractByte2IntMap
Returns:
a set view of the keys of this map; it may be safely cast to a type-specific interface.

values

public Collection values()
Description copied from class: AbstractByte2IntMap
Returns a type-specific-set view of the values of this map.

The view is backed by the set returned by Map.entrySet(). Note that no attempt is made at caching the result of this method, as this would require adding some attributes that lightweight implementations would not need. Subclasses may easily override this policy by calling this method and caching the result, but implementors are encouraged to write more efficient ad-hoc implementations.

Specified by:
values in interface Map
Overrides:
values in class AbstractByte2IntMap
Returns:
a set view of the values of this map; it may be safely cast to a type-specific interface.

get

public int get(byte k)
Description copied from interface: Byte2IntMap
Returns the value to which the given key is mapped.

Specified by:
get in interface Byte2IntMap
Parameters:
k - 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)

size

public int size()
Specified by:
size in interface Map

clone

public Object clone()