com.github.dm.jrt.util.WeakIdentityHashMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jroutine Show documentation
Show all versions of jroutine Show documentation
Parallel programming on the go
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.dm.jrt.util;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
/**
* Map implementation combining the features of {@link java.util.IdentityHashMap} and
* {@link java.util.WeakHashMap}.
*
* Note that the map entries might change each time the object is explicitly accessed.
*
* Created by davide-maestroni on 11/17/2014.
*
* @param the key type.
* @param the value type.
*/
public class WeakIdentityHashMap implements Map {
private final HashMap mMap;
private final ReferenceQueue