Package org.biojava.nbio.ontology.utils
Class SmallMap
java.lang.Object
java.util.AbstractMap
org.biojava.nbio.ontology.utils.SmallMap
- All Implemented Interfaces:
Serializable
,Map
Lightweight implementation of Map which uses little memory to store a
small number of mappings, at the expense of scalability. Not recommended
for more than 20-30 mappings.
This implementation has the useful property that the iteration order is the same as the order in which mappings are added.
- Author:
- Thomas Down, Len Trigg
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, putAll, remove, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SmallMap
public SmallMap() -
SmallMap
public SmallMap(int size) -
SmallMap
-
-
Method Details
-
get
- Specified by:
get
in interfaceMap
- Overrides:
get
in classAbstractMap
- Throws:
NullPointerException
- if key is null
-
put
- Specified by:
put
in interfaceMap
- Overrides:
put
in classAbstractMap
- Throws:
NullPointerException
- if key is null
-
keySet
- Specified by:
keySet
in interfaceMap
- Overrides:
keySet
in classAbstractMap
-
entrySet
- Specified by:
entrySet
in interfaceMap
- Specified by:
entrySet
in classAbstractMap
-
size
public int size()- Specified by:
size
in interfaceMap
- Overrides:
size
in classAbstractMap
-
containsKey
- Specified by:
containsKey
in interfaceMap
- Overrides:
containsKey
in classAbstractMap
-