com.carbonfive.flash
Class IdentityMap

java.lang.Object
  extended by com.carbonfive.flash.IdentityMap

public class IdentityMap
extends java.lang.Object

A lightweight HashMap (not all methods implemented) that wraps keys with an object that uses equivalence (==) for equals() and hashCode(). It is useful for caching objects by reference (regardless of their equals() implementation). Specifically, we needed it for handling ASObject references.

Author:
Alon Salont

Constructor Summary
IdentityMap()
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
           
 java.lang.Object get(java.lang.Object key)
           
 void put(java.lang.Object key, java.lang.Object value)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IdentityMap

public IdentityMap()
Method Detail

put

public void put(java.lang.Object key,
                java.lang.Object value)

get

public java.lang.Object get(java.lang.Object key)

containsKey

public boolean containsKey(java.lang.Object key)

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object