Package com.jalios.util
Class ObjectFloatHashMap<K>
java.lang.Object
java.util.AbstractMap<K,float[]>
java.util.HashMap<K,float[]>
com.jalios.util.ObjectFloatHashMap<K>
- Type Parameters:
K- any Object type
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,float[]>
This class is a map which binds key Object to float value.
This class is NOT thread safe, synchronize read and write
operation when used in multi-threaded context if you really need features
provided by this collection.
In multithreaded context, it may be wiser to use alternative thread safe and type safe
collection such as ConcurrentHashMap<YourType, Float>.
- Since:
- jcms-5.5.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()floatReturn the float value associated with given object, or the given default value if object is not in this map.floatgetMax()Return maximum value stored in this map.floatgetMin()Return minimum value stored in this map.voidAssociates the specified value with the specified key in this map.float[]Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
ObjectFloatHashMap
public ObjectFloatHashMap()
-
-
Method Details
-
remove
-
clear
public void clear() -
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.- Parameters:
key- key with which the specified value is to be associated.value- value to be associated with the specified key.
-
getFloat
Return the float value associated with given object, or the given default value if object is not in this map.- Parameters:
key- the object from which to get associated valuedefaultValue- the default value to use if object not present.- Returns:
- float value associated to object
-
getMax
public float getMax()Return maximum value stored in this map.- Returns:
- maximum float value
-
getMin
public float getMin()Return minimum value stored in this map.- Returns:
- minimum float value
-