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

java.lang.Object
  extended byit.unimi.dsi.fastutil.ints.AbstractInt2BooleanMap
      extended byit.unimi.dsi.fastutil.ints.Int2BooleanMaps.Singleton
All Implemented Interfaces:
Cloneable, Int2BooleanMap, Map, Serializable
Direct Known Subclasses:
Int2BooleanSortedMaps.Singleton
Enclosing class:
Int2BooleanMaps

public static class Int2BooleanMaps.Singleton
extends AbstractInt2BooleanMap
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.AbstractInt2BooleanMap
AbstractInt2BooleanMap.BasicEntry
 
Nested classes inherited from class it.unimi.dsi.fastutil.ints.Int2BooleanMap
Int2BooleanMap.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(boolean v)
          Checks whether the given value is contained in values().
 Set entrySet()
           
 boolean 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.AbstractInt2BooleanMap
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: AbstractInt2BooleanMap
Checks whether the given value is contained in AbstractInt2BooleanMap.keySet().

Specified by:
containsKey in interface Int2BooleanMap
Overrides:
containsKey in class AbstractInt2BooleanMap

containsValue

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

Specified by:
containsValue in interface Int2BooleanMap
Overrides:
containsValue in class AbstractInt2BooleanMap

putAll

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

entrySet

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

keySet

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

get

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

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