Package it.unimi.dsi.fastutil.chars
Class Char2ReferenceFunctions.UnmodifiableFunction<V>
java.lang.Object
it.unimi.dsi.fastutil.chars.AbstractChar2ReferenceFunction<V>
it.unimi.dsi.fastutil.chars.Char2ReferenceFunctions.UnmodifiableFunction<V>
- All Implemented Interfaces:
Char2ReferenceFunction<V>,it.unimi.dsi.fastutil.Function<java.lang.Character,V>,java.io.Serializable,java.util.function.Function<java.lang.Character,V>,java.util.function.IntFunction<V>
- Direct Known Subclasses:
Char2ReferenceMaps.UnmodifiableMap
- Enclosing class:
- Char2ReferenceFunctions
public static class Char2ReferenceFunctions.UnmodifiableFunction<V> extends AbstractChar2ReferenceFunction<V> implements java.io.Serializable
An unmodifiable wrapper class for functions.
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description voidclear()booleancontainsKey(char k)Returns true if this function contains a mapping for the specified key.VdefaultReturnValue()Gets the default return value.voiddefaultReturnValue(V defRetValue)Sets the default return value (optional operation).booleanequals(java.lang.Object o)Vget(char k)Returns the value to which the given key is mapped.Vget(java.lang.Object k)Deprecated.Please use the corresponding type-specific method instead.VgetOrDefault(char k, V defaultValue)Returns the value associated by this function to the specified key, or give the specified value if not present.VgetOrDefault(java.lang.Object k, V defaultValue)Deprecated.Please use the corresponding type-specific method instead.inthashCode()Vput(char k, V v)Adds a pair to the map (optional operation).Vput(java.lang.Character k, V v)Deprecated.Please use the corresponding type-specific method instead.Vremove(char k)Removes the mapping with the given key (optional operation).Vremove(java.lang.Object k)Deprecated.Please use the corresponding type-specific method instead.intsize()java.lang.StringtoString()Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.chars.Char2ReferenceFunction
andThenByte, andThenChar, andThenDouble, andThenFloat, andThenInt, andThenLong, andThenObject, andThenReference, andThenShort, apply, compose, composeByte, composeChar, composeDouble, composeFloat, composeInt, composeLong, composeObject, composeReference, composeShort, containsKeyMethods inherited from interface it.unimi.dsi.fastutil.Function
applyMethods inherited from interface java.util.function.Function
andThen
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
defaultReturnValue
Description copied from interface:Char2ReferenceFunctionGets the default return value.This default implementation just return the default null value of the type (
nullfor objects, 0 for scalars, false for Booleans).- Specified by:
defaultReturnValuein interfaceChar2ReferenceFunction<V>- Overrides:
defaultReturnValuein classAbstractChar2ReferenceFunction<V>- Returns:
- the current default return value.
-
defaultReturnValue
Description copied from interface:Char2ReferenceFunctionSets the default return value (optional operation). This value must be returned by type-specific versions ofget(),put()andremove()to denote that the map does not contain the specified key. It must be 0/false/nullby default.- Specified by:
defaultReturnValuein interfaceChar2ReferenceFunction<V>- Overrides:
defaultReturnValuein classAbstractChar2ReferenceFunction<V>- Parameters:
defRetValue- the new default return value.- See Also:
Char2ReferenceFunction.defaultReturnValue()
-
containsKey
public boolean containsKey(char k)Description copied from interface:Char2ReferenceFunctionReturns true if this function contains a mapping for the specified key.Note that for some kind of functions (e.g., hashes) this method will always return true. In particular, this default implementation always returns true.
- Specified by:
containsKeyin interfaceChar2ReferenceFunction<V>- Parameters:
k- the key.- Returns:
- true if this function associates a value to
key. - See Also:
Function.containsKey(Object)
-
put
Description copied from interface:Char2ReferenceFunctionAdds a pair to the map (optional operation).- Specified by:
putin interfaceChar2ReferenceFunction<V>- Parameters:
k- the key.v- the value.- Returns:
- the old value, or the default return value if no value was present for the given key.
- See Also:
Function.put(Object,Object)
-
get
Description copied from interface:Char2ReferenceFunctionReturns the value to which the given key is mapped.- Specified by:
getin interfaceChar2ReferenceFunction<V>- Parameters:
k- the key.- Returns:
- the corresponding value, or the default return value if no value was present for the given key.
- See Also:
Function.get(Object)
-
getOrDefault
Description copied from interface:Char2ReferenceFunctionReturns the value associated by this function to the specified key, or give the specified value if not present.- Specified by:
getOrDefaultin interfaceChar2ReferenceFunction<V>- Parameters:
k- the key.defaultValue- the value to return if not present.- Returns:
- the corresponding value, or
defaultValueif no value was present for the given key. - See Also:
Function.getOrDefault(Object, Object)
-
remove
Description copied from interface:Char2ReferenceFunctionRemoves the mapping with the given key (optional operation).- Specified by:
removein interfaceChar2ReferenceFunction<V>- Parameters:
k- the key.- Returns:
- the old value, or the default return value if no value was present for the given key.
- See Also:
Function.remove(Object)
-
clear
public void clear()- Specified by:
clearin interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
put
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
putin interfaceChar2ReferenceFunction<V>- Specified by:
putin interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
get
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
getin interfaceChar2ReferenceFunction<V>- Specified by:
getin interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
getOrDefault
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
getOrDefaultin interfaceChar2ReferenceFunction<V>- Specified by:
getOrDefaultin interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
remove
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
removein interfaceChar2ReferenceFunction<V>- Specified by:
removein interfaceit.unimi.dsi.fastutil.Function<java.lang.Character,V>
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-