Package org.scijava.cache
Class DefaultCacheService
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.cache.DefaultCacheService
-
- All Implemented Interfaces:
Comparable<Prioritized>,CacheService,Contextual,Disposable,Identifiable,Initializable,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,SciJavaService,Service,Versioned
public class DefaultCacheService extends AbstractService implements CacheService
TrivialCacheServiceimplementation. Wraps aWeakHashMap
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object key)voidinitialize()Performs any needed initialization when the service is first loaded.voidput(Object key, Object value)Stores the given object in the cache.-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.cache.CacheService
get
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
put
public void put(Object key, Object value)
Description copied from interface:CacheServiceStores the given object in the cache.- Specified by:
putin interfaceCacheService- Parameters:
key- A key.value- A value.
-
get
public Object get(Object key)
- Specified by:
getin interfaceCacheService- Parameters:
key- A key- Returns:
- The cached object, or null if the object is not in the cache.
-
initialize
public void initialize()
Description copied from interface:ServicePerforms any needed initialization when the service is first loaded.NB: This method is not intended to be called directly. It is called by the service framework itself (specifically by the
ServiceHelper) when initializing the service. It should not be called a second time.- Specified by:
initializein interfaceInitializable- Specified by:
initializein interfaceService
-
-