protected class BlogCacheManager.FuturePostCache extends Object
| Modifier and Type | Field and Description | 
|---|---|
private Map<String,BlogCacheManager.Post> | 
_posts
The posts, indexed by ID. 
 | 
private Multimap<Date,String> | 
_sortedPostIds
The posts id, indexed by date. 
 | 
| Constructor and Description | 
|---|
FuturePostCache()
Construct a AllPostCache instance. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addPost(Content content)
Add a post to the cache. 
 | 
void | 
clear()
Clear the cache. 
 | 
BlogCacheManager.Post | 
getPost(String id)
Test if a post exists, provided its ID. 
 | 
boolean | 
hasPost(String id)
Test if a post exists, provided its ID. 
 | 
Collection<BlogCacheManager.Post> | 
removePastPosts()
Remove the post that are not future anymore (given the current date) 
 | 
void | 
removePost(BlogCacheManager.Post post)
Remove a post from the cache. 
 | 
void | 
removePost(Content content)
Remove a post from the cache. 
 | 
private Map<String,BlogCacheManager.Post> _posts
private Multimap<Date,String> _sortedPostIds
public FuturePostCache()
public Collection<BlogCacheManager.Post> removePastPosts()
public BlogCacheManager.Post getPost(String id)
id - the post content ID.public boolean hasPost(String id)
id - the post content ID.public void addPost(Content content)
content - the post content.public void removePost(Content content)
content - the post content to remove from the cache.public void removePost(BlogCacheManager.Post post)
post - the post content to remove from the cache.public void clear()