List of usage examples for org.apache.commons.collections.map ReferenceIdentityMap ReferenceIdentityMap
public ReferenceIdentityMap(int keyType, int valueType)
ReferenceIdentityMap
that will use the specified types of references. From source file:com.google.gwt.dev.shell.designtime.WrappersCache.java
/** * Weakly caches a wrapper for a given Java Object. * //from w w w.j a va2s.c om * @param javaObject * the Object being wrapped * @param wrapper * the mapped wrapper */ @SuppressWarnings("unchecked") public static void putWrapperForObject(ClassLoader cl, Object javaObject, Object wrapper) { Map<Object, Object> cache = m_javaWrapperCache.get(cl); if (cache == null) { cache = new ReferenceIdentityMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK); m_javaWrapperCache.put(cl, cache); } cache.put(javaObject, wrapper); }