org.objectweb.carol.cmi

Class WeakCache


public class WeakCache
extends java.lang.Object

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

Method Summary

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

Method Details

getCached

public Object getCached(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.