SK.gnome.dwarf.utils.cache
Class LFUCache

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.thread.ThreadService
          extended bySK.gnome.dwarf.utils.cache.LRUCache
              extended bySK.gnome.dwarf.utils.cache.LFUCache
All Implemented Interfaces:
Cache, Reportable, java.lang.Runnable, Service

public class LFUCache
extends LRUCache

This class implements cache using the LFU algorithm.


Nested Class Summary
 
Nested classes inherited from class SK.gnome.dwarf.utils.cache.LRUCache
LRUCache.CacheEntry
 
Field Summary
 
Fields inherited from class SK.gnome.dwarf.utils.cache.LRUCache
entries
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadService
daemon, thread
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
LFUCache(java.lang.String name)
          Creates a new LFUCache.
 
Method Summary
protected  LRUCache.CacheEntry removeEntry()
          Removes a cache entry from the list.
protected  void updateEntries(LRUCache.CacheEntry entry)
          Updates the order of the cache entries in the list.
 
Methods inherited from class SK.gnome.dwarf.utils.cache.LRUCache
addEntry, clear, enableThread, get, loop, put, remove, report, setCheckingInterval, setSize, setTimeout, shutdown, start
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadService
finish, run, setDaemon, stop
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, init, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LFUCache

public LFUCache(java.lang.String name)
Creates a new LFUCache.

Method Detail

removeEntry

protected LRUCache.CacheEntry removeEntry()
Removes a cache entry from the list.

This method searches the entire list and removes the least frequently used entry from it.

Overrides:
removeEntry in class LRUCache
Returns:
CacheEntry the cache entry representing the object to be removed

updateEntries

protected void updateEntries(LRUCache.CacheEntry entry)
Updates the order of the cache entries in the list.

This method does actually nothing.

Overrides:
updateEntries in class LRUCache
Parameters:
entry - the cache entry representing the cached object


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.