| <?
class ObjectCache {
	var $cache=array();
	
	function add($anOID,&$obj) {
		$this->cache[$anOID] =& $obj;
	}
	
	function remove($anOID) {
		unset($this->cache[$anOID]);
	}
	
	function &find($anOID) {
		if ($this->cache[$anOID]) return $this->cache[$anOID];
		return null;
	}
	function isExist($anOID) {
		if ($this->cache[$anOID]) return true;
		return false;
	}
	
	function isEmpty() {
		if (count($this->cache)>0) return true;
		return false;
	}
	
	function getKeys() {
		return array_keys($this->cache);
	}
	
	function len() {
		return count($this->cache);
	}
	
	function clear() {
		$this->cache = array();
	}
}
?>
 |