|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The generic type of the hard references in the queue.public interface IHardReferenceQueue<T>
Interface for a hard reference queue.
| Field Summary | |
|---|---|
static int |
DEFAULT_NSCAN
A reasonable default for the #of references on the head of the queue that should be tested before a reference is appended to the queue. |
| Method Summary | |
|---|---|
boolean |
add(T ref)
Add a reference to the cache. |
int |
capacity()
The cache capacity. |
void |
clear(boolean clearRefs)
Clears the cache (sets the head, tail and count to zero) without generating eviction notices. |
boolean |
evict()
Evict the LRU reference. |
void |
evictAll(boolean clearRefs)
Evict all references, starting with the LRU reference and proceeding to the MRU reference. |
boolean |
isEmpty()
True iff the cache is empty. |
boolean |
isFull()
True iff the cache is full. |
int |
nscan()
The #of references that are tested on append requests. |
T |
peek()
The reference at the tail of the queue. |
int |
size()
The #of references in the cache. |
| Field Detail |
|---|
static final int DEFAULT_NSCAN
| Method Detail |
|---|
int capacity()
int nscan()
int size()
boolean isEmpty()
boolean isFull()
boolean add(T ref)
ref - The reference to be added.
boolean evict()
HardReferenceQueueEvictionListenervoid clear(boolean clearRefs)
clearRefs - When true the references are explicitly set to
null which can facilitate garbage collection.void evictAll(boolean clearRefs)
clearRefs - When true, the reference are actually cleared from the cache.
This may be false to force persistence of the references in
the cache without actually clearing the cache.T peek()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||