hudson.util
Class PackedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
hudson.util.PackedMap<K,V>
- All Implemented Interfaces:
- Map<K,V>
public final class PackedMap<K,V>
- extends AbstractMap<K,V>
Read-only map implementation that uses less memory than HashMap
/TreeMap
.
The implementation is backed by a single exact-length array, so this implementation has the following
performance characteristics.
- iteration is fast (but creates a lot of short-lived objects.)
- lookup is O(N)
- memory consumption is low
- Author:
- Kohsuke Kawaguchi
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class java.util.AbstractMap |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString |
of
public static <K,V> PackedMap<K,V> of(Map<? extends K,? extends V> src)
- Parameters:
src
- Map to copy contents from. Iteration order is preserved.
entrySet
public Set<Map.Entry<K,V>> entrySet()
- Specified by:
entrySet
in interface Map<K,V>
- Specified by:
entrySet
in class AbstractMap<K,V>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interface Map<K,V>
- Overrides:
containsKey
in class AbstractMap<K,V>
get
public V get(Object key)
- Specified by:
get
in interface Map<K,V>
- Overrides:
get
in class AbstractMap<K,V>
values
public Collection<V> values()
- Specified by:
values
in interface Map<K,V>
- Overrides:
values
in class AbstractMap<K,V>
Copyright © 2004-2013. All Rights Reserved.