function CacheItem(key,value)
{
this.key=key;
this.value=value;
}
function CacheInfo()
{
this.Items = new Array();
this.GetItem = GetCacheItem;
this.Add = AddCacheItem;
this.Modify = ModifyCacheItem;
this.Remove = RemoveCacheItem;
this.Clear = ClearCacheItem;
}
function AddCacheItem(key,value)
{
this.Items[this.Items.length] = new CacheItem(key,value);
}
function ModifyCacheItem(key,value)
{
if(!this.Items) return;
var i;
for(i=0;i < this.Items.length;i++)
{
if(this.Items)
{
if(this.Items.key == key)
{
this.Items=value;
break;
}
}
}
}
function RemoveCacheItem(key)
{
if(!this.Items) return;
var i;
for(i=0;i < this.Items.length;i++)
{
if(this.Items)
{
if(this.Items.key == key)
{
this.Items=null;
break;
}
}
}
}
function GetCacheItem(key)
{
if(!this.Items) return null;
var i;
var value = null;
for(i=0;i < this.Items.length;i++)
{
if(this.Items)
{
if(this.Items.key == key)
{
value = this.Items.value;
break;
}
}
}
return value;
}
function ClearCacheItem()
{
if(!this.Items) return;
var i;
for(i=0;i < this.Items.length;i++)
{
this.Items=null;
}
}
var ScriptCache=new CacheInfo();
function CacheItem(b,a){this.key=b;this.value=a}function CacheInfo(){this.Items=[];this.GetItem=GetCacheItem;this.Add=AddCacheItem;this.Modify=ModifyCacheItem;this.Remove=RemoveCacheItem;this.Clear=ClearCacheItem}function AddCacheItem(b,a){this.Items[this.Items.length]=new CacheItem(b,a)}function ModifyCacheItem(b,a){if(this.Items){var c;for(c=0;c<this.Items.length;c++)if(this.Items[c]&&this.Items[c].key==b){this.Items[c]=a;break}}}
function RemoveCacheItem(b){if(this.Items){var a;for(a=0;a<this.Items.length;a++)if(this.Items[a]&&this.Items[a].key==b){this.Items[a]=null;break}}}function GetCacheItem(b){if(!this.Items)return null;var a,c=null;for(a=0;a<this.Items.length;a++)if(this.Items[a]&&this.Items[a].key==b){c=this.Items[a].value;break}return c}function ClearCacheItem(){if(this.Items){var b;for(b=0;b<this.Items.length;b++)this.Items=null}}var ScriptCache=new CacheInfo;
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |