public static class Byte2LongMaps.UnmodifiableMap extends Byte2LongFunctions.UnmodifiableFunction implements Byte2LongMap, Serializable
Byte2LongMap.Entry, Byte2LongMap.FastEntrySet| Modifier and Type | Method and Description |
|---|---|
ObjectSet<Byte2LongMap.Entry> |
byte2LongEntrySet()
Returns a type-specific set view of the mappings contained in this map.
|
void |
clear()
Removes all associations from this function (optional operation).
|
boolean |
containsKey(byte k) |
boolean |
containsKey(Object ok)
Returns true if this function contains a mapping for the specified key.
|
boolean |
containsValue(long v) |
boolean |
containsValue(Object ov) |
long |
defaultReturnValue()
Gets the default return value.
|
void |
defaultReturnValue(long defRetValue)
Sets the default return value.
|
ObjectSet<Map.Entry<Byte,Long>> |
entrySet()
Returns a set view of the mappings contained in this map.
|
long |
get(byte k)
Returns the value to which the given key is mapped.
|
boolean |
isEmpty() |
ByteSet |
keySet()
Returns a set view of the keys contained in this map.
|
long |
put(byte k,
long v)
Adds a pair to the map.
|
Long |
put(Byte k,
Long v)
Delegates to the corresponding type-specific method, taking care of returning
null on a missing key. |
void |
putAll(Map<? extends Byte,? extends Long> m) |
long |
remove(byte k)
Removes the mapping with the given key.
|
int |
size()
Returns the intended number of keys in this function, or -1 if no such number exists.
|
String |
toString() |
LongCollection |
values()
Returns a set view of the values contained in this map.
|
get, removepublic int size()
FunctionMost function implementations will have some knowledge of the intended number of keys in their domain. In some cases, however, this might not be possible.
public boolean containsKey(byte k)
containsKey in interface Byte2LongFunctioncontainsKey in class Byte2LongFunctions.UnmodifiableFunctionFunction.containsKey(Object)public boolean containsValue(long v)
containsValue in interface Byte2LongMapMap.containsValue(Object)public long defaultReturnValue()
Byte2LongFunctiondefaultReturnValue in interface Byte2LongFunctiondefaultReturnValue in class Byte2LongFunctions.UnmodifiableFunctionpublic void defaultReturnValue(long defRetValue)
Byte2LongFunctionget(), put() and remove() to
denote that the map does not contain the specified key. It must be
0/false/null by default.defaultReturnValue in interface Byte2LongFunctiondefaultReturnValue in class Byte2LongFunctions.UnmodifiableFunctiondefRetValue - the new default return value.Byte2LongFunction.defaultReturnValue()public long put(byte k,
long v)
Byte2LongFunctionput in interface Byte2LongFunctionput in class Byte2LongFunctions.UnmodifiableFunctionk - the key.v - the value.Function.put(Object,Object)public ObjectSet<Byte2LongMap.Entry> byte2LongEntrySet()
Byte2LongMapThis method is necessary because there is no inheritance along
type parameters: it is thus impossible to strengthen Byte2LongMap.entrySet()
so that it returns an ObjectSet
of objects of type Map.Entry (the latter makes it possible to
access keys and values with type-specific methods).
byte2LongEntrySet in interface Byte2LongMapByte2LongMap.entrySet()public ByteSet keySet()
Byte2LongMapNote that this specification strengthens the one given in Map.keySet().
keySet in interface Byte2LongMapkeySet in interface Map<Byte,Long>Map.keySet()public LongCollection values()
Byte2LongMapNote that this specification strengthens the one given in Map.values().
values in interface Byte2LongMapvalues in interface Map<Byte,Long>Map.values()public void clear()
Functionpublic String toString()
toString in class Byte2LongFunctions.UnmodifiableFunctionpublic Long put(Byte k, Long v)
AbstractByte2LongFunctionnull on a missing key.
This method must check whether the provided key is in the map using containsKey(). Thus,
it probes the map twice. Implementors of subclasses should override it with a more efficient method.
public long remove(byte k)
Byte2LongFunctionremove in interface Byte2LongFunctionremove in class Byte2LongFunctions.UnmodifiableFunctionFunction.remove(Object)public long get(byte k)
Byte2LongFunctionget in interface Byte2LongFunctionget in class Byte2LongFunctions.UnmodifiableFunctionk - the key.Function.get(Object)public boolean containsKey(Object ok)
FunctionNote that for some kind of functions (e.g., hashes) this method will always return true.
containsKey in interface Function<Byte,Long>containsKey in interface Map<Byte,Long>containsKey in class Byte2LongFunctions.UnmodifiableFunctionok - the key.key.Map.containsKey(Object)public boolean containsValue(Object ov)
containsValue in interface Map<Byte,Long>public ObjectSet<Map.Entry<Byte,Long>> entrySet()
Byte2LongMapNote that this specification strengthens the one given in Map.entrySet().
entrySet in interface Byte2LongMapentrySet in interface Map<Byte,Long>Map.entrySet()