示例#1
0
 /** Remove a CacheEntry from linked list */
 protected void removeEntry(CacheEntry entry) {
   if (entry == _first) {
     _first = entry._next;
   }
   if (_last == entry) {
     _last = entry._previous;
   }
   CacheEntry previous = entry._previous;
   CacheEntry next = entry._next;
   if (previous != null) {
     previous._next = next;
   }
   if (next != null) {
     next._previous = previous;
   }
   entry._previous = null;
   entry._next = null;
 }
示例#2
0
 /** Add a CacheEntry. Entry goes at the end of the list. */
 protected void addEntry(CacheEntry entry) {
   if (_first == null) {
     _first = entry;
     _last = entry;
   } else {
     _last._next = entry;
     entry._previous = _last;
     _last = entry;
   }
 }