org.biojava.utils
Class SmallMap
java.lang.Object
java.util.AbstractMap
org.biojava.utils.SmallMap
- All Implemented Interfaces:
- Map, Serializable
- 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
SmallMap
public SmallMap()
SmallMap
public SmallMap(int size)
SmallMap
public SmallMap(Map m)
get
public Object get(Object key)
- Specified by:
get in interface Map
- Throws:
NullPointerException - if key is null
put
public Object put(Object key,
Object value)
- Specified by:
put in interface Map
- Throws:
NullPointerException - if key is null
keySet
public Set keySet()
- Specified by:
keySet in interface Map
entrySet
public Set entrySet()
- Specified by:
entrySet in interface Map
size
public int size()
- Specified by:
size in interface Map
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map