|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rometools.fetcher.impl.HashMapFeedInfoCache
public class HashMapFeedInfoCache
A very simple implementation of the FeedFetcherCache
interface.
This implementation uses a HashMap to cache retrieved feeds. This implementation is most suitible for sort term (client aggregator?) use, as the memory usage will increase over time as the number of feeds in the cache increases.
Constructor Summary | |
---|---|
HashMapFeedInfoCache()
Constructor for HashMapFeedInfoCache Only use this if you want multiple instances of the cache. |
Method Summary | |
---|---|
void |
clear()
Removes all items from the cache. |
protected Map |
createInfoCache()
|
protected Object |
get(Object key)
|
SyndFeedInfo |
getFeedInfo(URL feedUrl)
Get a SyndFeedInfo object from the cache. |
protected Map |
getInfoCache()
|
static FeedFetcherCache |
getInstance()
Get the global instance of the cache |
protected void |
put(Object key,
Object value)
|
SyndFeedInfo |
remove(URL url)
Removes the SyndFeedInfo identified by the url from the cache. |
void |
setFeedInfo(URL feedUrl,
SyndFeedInfo syndFeedInfo)
Add a SyndFeedInfo object to the cache |
protected void |
setInfoCache(Map map)
The API of this class indicates that map must thread safe. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashMapFeedInfoCache()
Constructor for HashMapFeedInfoCache
Only use this if you want multiple instances of the cache. Usually getInstance() is more appropriate.
Method Detail |
---|
public static FeedFetcherCache getInstance()
protected Map createInfoCache()
protected Object get(Object key)
public SyndFeedInfo getFeedInfo(URL feedUrl)
FeedFetcherCache
getFeedInfo
in interface FeedFetcherCache
feedUrl
- The url of the feed
extensions.io.FeedFetcherCache#getFeedInfo(java.net.URL)
protected void put(Object key, Object value)
public void setFeedInfo(URL feedUrl, SyndFeedInfo syndFeedInfo)
FeedFetcherCache
setFeedInfo
in interface FeedFetcherCache
feedUrl
- The url of the feedsyndFeedInfo
- A SyndFeedInfo for the feedextensions.io.FeedFetcherCache#setFeedInfo(java.net.URL, extensions.io.SyndFeedInfo)
protected final Map getInfoCache()
protected final void setInfoCache(Map map)
map
- the map to use as the info cache.public void clear()
FeedFetcherCache
clear
in interface FeedFetcherCache
com.sun.syndication.fetcher.impl.FeedFetcherCache#clear()
public SyndFeedInfo remove(URL url)
FeedFetcherCache
remove
in interface FeedFetcherCache
com.sun.syndication.fetcher.impl.FeedFetcherCache#remove(java.net.URL)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |