org.objectweb.carol.cmi
Class WeakCache

java.lang.Object
  extended byorg.objectweb.carol.cmi.WeakCache

public class WeakCache
extends java.lang.Object

An object cache, to reduce memory usage by returning always the same instance for equal objects.


Constructor Summary
WeakCache()
           
 
Method Summary
 java.lang.Object getCached(java.lang.Object obj)
          Registers an object in the cache or return an already registered equal object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakCache

public WeakCache()
Method Detail

getCached

public java.lang.Object getCached(java.lang.Object obj)
Registers an object in the cache or return an already registered equal object.

Parameters:
obj - Object to register.
Returns:
the copy to use.