public NWayAssociateSetChach(ICacheChangeAlgorithm changeAlgorithm, int setCount, int rowInSetCount)
 {
     this.setCount        = setCount;
     this.entryCount      = rowInSetCount;
     this.replacementAlgo = changeAlgorithm;
     CacheMemory          = new CachObj[this.setCount * this.entryCount];
     Clear();
 }
Example #2
0
        public void Init()
        {
            algo  = new LRUreplacementAlgorithm();
            cache = new NWayAssociateSetChach(algo, 3, 8);
            TestPerson person = new TestPerson("petrov", "Петров П.П.");

            cache.Put(person.NickName, person);
            person = new TestPerson("sidorov", "Сидоров П.П.");
            cache.Put(person.NickName, person);
        }