|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
P
- Page typepublic interface Cache<P extends Page<P>>
Defines the requirements for a cache that stores objects implementing the Page interface.
Method Summary | |
---|---|
void |
clear()
Clears this cache. |
void |
flush()
Flushes this cache by writing any entry to the underlying file. |
P |
get(int id)
Retrieves a page from this cache. |
long |
getPageAccess()
Returns the number of page accesses. |
void |
initialize(long cacheSize,
CachedFile<P> file)
Initializes this cache with the specified parameters. |
void |
put(P object)
Adds an object to this cache. |
P |
remove(int id)
Removes an object from this cache. |
void |
resetPageAccess()
Resets the pages access of this cache. |
void |
setCacheSize(int cacheSize)
Sets the maximum size of this cache. |
Method Detail |
---|
void initialize(long cacheSize, CachedFile<P> file)
cacheSize
- the maximum number of pages in this cachefile
- the underlying file of this cache, if a page is dropped it is
written to the fileP get(int id)
id
- the id of the page to be returned.
void put(P object)
object
- the object to be addedP remove(int id)
id
- the id of the object to be removed
void flush()
void clear()
void setCacheSize(int cacheSize)
cacheSize
- the cache size to be setlong getPageAccess()
void resetPageAccess()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |