net.sf.retrotranslator.runtime.impl
Class WeakIdentityTable<K,V>

java.lang.Object
  extended by net.sf.retrotranslator.runtime.impl.WeakIdentityTable<K,V>

public class WeakIdentityTable<K,V>
extends java.lang.Object

Author:
Taras Puchko

Nested Class Summary
private static interface WeakIdentityTable.IdentityKey<T>
           
private static class WeakIdentityTable.StrongKey<T>
           
private static class WeakIdentityTable.WeakKey<T>
           
 
Field Summary
private  java.util.concurrent.ConcurrentMap<WeakIdentityTable.IdentityKey<K>,V> map
           
private  java.lang.ref.ReferenceQueue<K> queue
           
 
Constructor Summary
WeakIdentityTable()
           
 
Method Summary
private  void cleanup()
           
protected  V initialValue()
           
 V lookup(K key)
           
 V obtain(K key)
           
 void putIfAbsent(K key, V value)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private final java.util.concurrent.ConcurrentMap<WeakIdentityTable.IdentityKey<K>,V> map

queue

private final java.lang.ref.ReferenceQueue<K> queue
Constructor Detail

WeakIdentityTable

public WeakIdentityTable()
Method Detail

lookup

public V lookup(K key)

obtain

public V obtain(K key)

putIfAbsent

public void putIfAbsent(K key,
                        V value)

size

public int size()

initialValue

protected V initialValue()

cleanup

private void cleanup()