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
public class SmallMap extends AbstractMap implements Serializable
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:
- Serialized Form
-
-
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>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(Object key)SetentrySet()Objectget(Object key)SetkeySet()Objectput(Object key, Object value)intsize()-
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
-
-
-
-
Method Detail
-
get
public Object get(Object key)
- Specified by:
getin interfaceMap- Overrides:
getin classAbstractMap- Throws:
NullPointerException- if key is null
-
put
public Object put(Object key, Object value)
- Specified by:
putin interfaceMap- Overrides:
putin classAbstractMap- Throws:
NullPointerException- if key is null
-
keySet
public Set keySet()
- Specified by:
keySetin interfaceMap- Overrides:
keySetin classAbstractMap
-
entrySet
public Set entrySet()
- Specified by:
entrySetin interfaceMap- Specified by:
entrySetin classAbstractMap
-
size
public int size()
- Specified by:
sizein interfaceMap- Overrides:
sizein classAbstractMap
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classAbstractMap
-
-