hudson.util
Class PackedMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by 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.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class PackedMap.ConverterImpl
          Should persist like a regular map.
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 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
 

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.

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.