Example usage for java.util WeakHashMap WeakHashMap

List of usage examples for java.util WeakHashMap WeakHashMap

Introduction

In this page you can find the example usage for java.util WeakHashMap WeakHashMap.

Prototype

public WeakHashMap(Map<? extends K, ? extends V> m) 

Source Link

Document

Constructs a new WeakHashMap with the same mappings as the specified map.

Usage

From source file:org.jiemamy.utils.collection.CollectionsUtil.java

/**
 * {@link WeakHashMap}?????//from w w  w.  j a v  a 2 s .  co m
 * 
 * @param <K> {@link WeakHashMap}??
 * @param <V> {@link WeakHashMap}??
 * @param initialCapacity ??
 * @return {@link WeakHashMap}???
 * @throws IllegalArgumentException  If the initial capacity is negative.
 * @see WeakHashMap#WeakHashMap(int)
 */
public static <K, V> WeakHashMap<K, V> newWeakHashMap(int initialCapacity) {
    return new WeakHashMap<K, V>(initialCapacity);
}

From source file:org.jiemamy.utils.collection.CollectionsUtil.java

/**
 * {@link WeakHashMap}?????/* ww  w  .  j  a  va2 s  . co m*/
 * 
 * @param <K> {@link WeakHashMap}??
 * @param <V> {@link WeakHashMap}??
 * @param m ?????
 * @return {@link WeakHashMap}???
 * @throws IllegalArgumentException ?{@code null}???
 * @see WeakHashMap#WeakHashMap(Map)
 */
public static <K, V> WeakHashMap<K, V> newWeakHashMap(Map<? extends K, ? extends V> m) {
    Validate.notNull(m);
    return new WeakHashMap<K, V>(m);
}