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 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