Package de.umass.lastfm.cache
Class MemoryCache
- java.lang.Object
-
- de.umass.lastfm.cache.Cache
-
- de.umass.lastfm.cache.MemoryCache
-
public class MemoryCache extends Cache
This class is just for testing. You probably don't want to use it in production.- Author:
- Janni Kovacs
-
-
Constructor Summary
Constructors Constructor Description MemoryCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the cache by effectively removing all cached data.boolean
contains(java.lang.String cacheEntryName)
Checks if the cache contains an entry with the given name.boolean
isExpired(java.lang.String cacheEntryName)
Checks if the specified entry is expired.java.io.InputStream
load(java.lang.String cacheEntryName)
Loads the specified entry from the cache and returns an InputStream to be read from.void
remove(java.lang.String cacheEntryName)
Removes the specified entry from the cache if available.void
store(java.lang.String cacheEntryName, java.io.InputStream inputStream, long expirationDate)
Stores a request in the cache.-
Methods inherited from class de.umass.lastfm.cache.Cache
createCacheEntryName, getExpirationPolicy, setExpirationPolicy, setHashCacheEntryNames
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.String cacheEntryName)
Description copied from class:Cache
Checks if the cache contains an entry with the given name.
-
load
public java.io.InputStream load(java.lang.String cacheEntryName)
Description copied from class:Cache
Loads the specified entry from the cache and returns an InputStream to be read from. Returnsnull
if the cache does not contain the specified cacheEntryName.
-
remove
public void remove(java.lang.String cacheEntryName)
Description copied from class:Cache
Removes the specified entry from the cache if available. Does nothing if no such entry is available.
-
store
public void store(java.lang.String cacheEntryName, java.io.InputStream inputStream, long expirationDate)
Description copied from class:Cache
Stores a request in the cache.
-
isExpired
public boolean isExpired(java.lang.String cacheEntryName)
Description copied from class:Cache
Checks if the specified entry is expired.
-
-