|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Byte2FloatFunction
A type-specific Function
; provides some additional methods that use polymorphism to avoid (un)boxing.
Type-specific versions of get()
, put()
and
remove()
cannot rely on null
to denote absence of
a key. Rather, they return a default
return value, which is set to 0 cast to the return type (false
for booleans) at creation, but can be changed using the
defaultReturnValue()
method.
For uniformity reasons, even maps returning objects implement the default
return value (of course, in this case the default return value is
initialized to null
).
Warning: to fall in line as much as possible with the
standard map interface, it is strongly suggested
that standard versions of get()
, put()
and
remove()
for maps with primitive-type values return
null
to denote missing keys rather than wrap the default
return value in an object (of course, for maps with object keys and values
this is not possible, as there is no type-specific version).
Function
Method Summary | |
---|---|
boolean |
containsKey(byte key)
|
float |
defaultReturnValue()
Gets the default return value. |
void |
defaultReturnValue(float rv)
Sets the default return value. |
float |
get(byte key)
Returns the value to which the given key is mapped. |
float |
put(byte key,
float value)
Adds a pair to the map. |
float |
remove(byte key)
Removes the mapping with the given key. |
Methods inherited from interface it.unimi.dsi.fastutil.Function |
---|
clear, containsKey, get, put, remove, size |
Method Detail |
---|
float put(byte key, float value)
key
- the key.value
- the value.
Function.put(Object,Object)
float get(byte key)
key
- the key.
Function.get(Object)
float remove(byte key)
key
-
Function.remove(Object)
boolean containsKey(byte key)
Function.containsKey(Object)
void defaultReturnValue(float rv)
get()
, put()
and remove()
to
denote that the map does not contain the specified key. It must be
0/false
/null
by default.
rv
- the new default return value.defaultReturnValue()
float defaultReturnValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |