protected class BlogCacheManager.AllPostCache extends Object
| Modifier and Type | Field and Description | 
|---|---|
private Map<String,BlogCacheManager.Post> | 
_posts
The posts, indexed by ID. 
 | 
private Map<String,BlogCacheManager.Post> | 
_postsByName
The posts, indexed by name. 
 | 
| Constructor and Description | 
|---|
AllPostCache()
Construct a AllPostCache instance. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addPost(BlogCacheManager.Post post)
Add a post to the cache. 
 | 
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. 
 | 
BlogCacheManager.Post | 
getPostByName(String name)
Test if a post exists, provided its content name. 
 | 
Set<String> | 
getPostIds()
Get a list of all the posts' IDs. 
 | 
Map<String,BlogCacheManager.Post> | 
getPosts()
Get the exhaustive list of Posts. 
 | 
boolean | 
hasPost(String id)
Test if a post exists, provided its ID. 
 | 
boolean | 
hasPostByName(String name)
Test if a post exists, provided its content name. 
 | 
void | 
removePost(Content content)
Remove a post from the cache. 
 | 
void | 
removePost(String id,
          String name)
Remove a post from the cache. 
 | 
private Map<String,BlogCacheManager.Post> _posts
private Map<String,BlogCacheManager.Post> _postsByName
public AllPostCache()
public Set<String> getPostIds()
public Map<String,BlogCacheManager.Post> getPosts()
public BlogCacheManager.Post getPost(String id)
id - the post content ID.public boolean hasPost(String id)
id - the post content ID.public BlogCacheManager.Post getPostByName(String name)
name - the post content name.public boolean hasPostByName(String name)
name - the post content name.public void addPost(Content content)
content - the post content.public void addPost(BlogCacheManager.Post post)
post - The postpublic void removePost(Content content)
content - the post content to remove from the cache.public void removePost(String id, String name)
id - The id of postname - The name of postpublic void clear()