/** * clear all the entries from the cache. * @returns the number of entries cleared from the cache */ public int clear() { CacheItem item=null, next=null; int count = 0; for (int index = 0; index < maxBuckets; index++) { synchronized (bucketLocks[index]) { for (item = buckets[index]; item != null; item = item.next) { next = item.next; item.next = null; count++; decrementEntryCount(); itemRemoved(item); if (entryCount == 0) break; } buckets[index] = null; } } return count; }
/** * clear all the entries from the cache. * @returns the number of entries cleared from the cache */ public int clear() { CacheItem item=null, next=null; int count = 0; for (int index = 0; index < maxBuckets; index++) { synchronized (bucketLocks[index]) { for (item = buckets[index]; item != null; item = item.next) { next = item.next; item.next = null; count++; decrementEntryCount(); itemRemoved(item); if (entryCount == 0) break; } buckets[index] = null; } } return count; }
/** * clear all the entries from the cache. * @returns the number of entries cleared from the cache */ public int clear() { CacheItem item=null, next=null; int count = 0; for (int index = 0; index < maxBuckets; index++) { synchronized (bucketLocks[index]) { for (item = buckets[index]; item != null; item = item.next) { next = item.next; item.next = null; count++; decrementEntryCount(); itemRemoved(item); if (entryCount == 0) break; } buckets[index] = null; } } return count; }
/** * clear all the entries from the cache. * @returns the number of entries cleared from the cache */ public int clear() { CacheItem item=null, next=null; int count = 0; for (int index = 0; index < maxBuckets; index++) { synchronized (bucketLocks[index]) { for (item = buckets[index]; item != null; item = item.next) { next = item.next; item.next = null; count++; decrementEntryCount(); itemRemoved(item); if (entryCount == 0) break; } buckets[index] = null; } } return count; }
itemRemoved((CacheItem)items.get(i));
itemRemoved((CacheItem)items.get(i));
itemRemoved((CacheItem)items.get(i));
itemRemoved((CacheItem)items.get(i));
itemRemoved(item); break;
itemRemoved(item); break;
itemRemoved(item); break;