Пример #1
0
        public bool ShouldDiscard(TickCountLruItem <K, V> item)
        {
            if (Environment.TickCount - item.TickCount > this.timeToLive)
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        public ItemDestination RouteCold(TickCountLruItem <K, V> item)
        {
            if (this.ShouldDiscard(item))
            {
                return(ItemDestination.Remove);
            }

            if (item.WasAccessed)
            {
                return(ItemDestination.Warm);
            }

            return(ItemDestination.Remove);
        }
Пример #3
0
 public void Touch(TickCountLruItem <K, V> item)
 {
     item.WasAccessed = true;
 }