it.unimi.dsi.fastutil.chars
Class Char2ByteMaps.Singleton

java.lang.Object
  extended byit.unimi.dsi.fastutil.chars.AbstractChar2ByteMap
      extended byit.unimi.dsi.fastutil.chars.Char2ByteMaps.Singleton
All Implemented Interfaces:
Char2ByteMap, Cloneable, Map, Serializable
Direct Known Subclasses:
Char2ByteSortedMaps.Singleton
Enclosing class:
Char2ByteMaps

public static class Char2ByteMaps.Singleton
extends AbstractChar2ByteMap
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.chars.AbstractChar2ByteMap
AbstractChar2ByteMap.BasicEntry
 
Nested classes inherited from class it.unimi.dsi.fastutil.chars.Char2ByteMap
Char2ByteMap.Entry
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 Object clone()
           
 boolean containsKey(char 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(char 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.chars.AbstractChar2ByteMap
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(char k)
Description copied from class: AbstractChar2ByteMap
Checks whether the given value is contained in AbstractChar2ByteMap.keySet().

Specified by:
containsKey in interface Char2ByteMap
Overrides:
containsKey in class AbstractChar2ByteMap

containsValue

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

Specified by:
containsValue in interface Char2ByteMap
Overrides:
containsValue in class AbstractChar2ByteMap

putAll

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

entrySet

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

keySet

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

get

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

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