it.unimi.dsi.fastutil.ints
Class Int2ByteMaps.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.ints.AbstractInt2ByteMap
      extended byit.unimi.dsi.fastutil.ints.Int2ByteMaps.Singleton
All Implemented Interfaces:
Cloneable, Int2ByteMap, Map, Serializable
Direct Known Subclasses:
Int2ByteSortedMaps.Singleton
Enclosing class:
Int2ByteMaps

public static class Int2ByteMaps.Singleton
extends AbstractInt2ByteMap
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.ints.AbstractInt2ByteMap
AbstractInt2ByteMap.BasicEntry
 
Nested classes inherited from class it.unimi.dsi.fastutil.ints.Int2ByteMap
Int2ByteMap.Entry
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 Object clone()
           
 boolean containsKey(int k)
          Checks whether the given value is contained in keySet().
 boolean containsValue(byte v)
          Checks whether the given value is contained in values().
 Set entrySet()
           
 byte get(int 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.ints.AbstractInt2ByteMap
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(int k)
Description copied from class: AbstractInt2ByteMap
Checks whether the given value is contained in AbstractInt2ByteMap.keySet().

Specified by:
containsKey in interface Int2ByteMap
Overrides:
containsKey in class AbstractInt2ByteMap

containsValue

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

Specified by:
containsValue in interface Int2ByteMap
Overrides:
containsValue in class AbstractInt2ByteMap

putAll

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

entrySet

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

keySet

public Set keySet()
Description copied from class: AbstractInt2ByteMap
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 AbstractInt2ByteMap
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: AbstractInt2ByteMap
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 AbstractInt2ByteMap
Returns:
a set view of the values of this map; it may be safely cast to a type-specific interface.

get

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

Specified by:
get in interface Int2ByteMap
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()