Package 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 thanHashMap
/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 Class Summary
Nested Classes Modifier and Type Class Description static class
PackedMap.ConverterImpl
Should persist like a regular map.-
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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object key)
Set<Map.Entry<K,V>>
entrySet()
V
get(Object key)
static <K,V>
PackedMap<K,V>of(Map<? extends K,? extends V> src)
Collection<V>
values()
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString
-
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
-
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.
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
- Overrides:
containsKey
in classAbstractMap<K,V>
-
values
@NonNull public Collection<V> values()
-
-