public void Add(CacheSummary[] summarys, IReplaceableCache cache)
        {
            if (summarys == null || cache == null)
            {
                return;
            }

            foreach (CacheSummary summary in summarys)
            {
                cache.AlgorithmData.AddToHead(summary);
            }
        }
Beispiel #2
0
        public void AddToHead(CacheSummary summary)
        {
            if (summary == null)
            {
                return;
            }

            Node<CacheSummary> node = new Node<CacheSummary>(summary);

            // add key & node pair into dictionary
            this.dataInDict.Add(summary.Key, node);

            // create new node and put it to the head of double link list
            this.dataInList.AddFirst(summary);
        }