internal void SetCachedValue(Object value)
        {
            NameCacheEntry entry = new NameCacheEntry();

            entry.name       = name;
            entry.value      = value;
            nameCache[probe] = entry;
        }
        internal Object GetCachedValue(String name)
        {
            this.name = name;
            probe     = Math.Abs(name.GetHashCode()) % MAX_CACHE_ENTRIES;
            NameCacheEntry entry = nameCache[probe];

            if (entry == null)
            {
                entry      = new NameCacheEntry();
                entry.name = name;
                return(null);
            }
            else if (entry.name == name)
            {
                return(entry.value);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
 internal void SetCachedValue(Object value)
 {
     NameCacheEntry entry = new NameCacheEntry();
     entry.name = name;
     entry.value = value;
     nameCache[probe] = entry;
 }
Ejemplo n.º 4
0
 internal Object GetCachedValue(String name)
 {
     this.name = name;
     probe = Math.Abs(name.GetHashCode())%MAX_CACHE_ENTRIES;
     NameCacheEntry entry = nameCache[probe];
     if (entry == null)
     {
         entry = new NameCacheEntry();
         entry.name = name;
         return null;
     }
     else if (entry.name == name)
     {
         return entry.value;
     }
     else
         return null;
 }