T
- The generic type of the hard references in the queue.public interface IHardReferenceQueue<T>
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
static final int DEFAULT_NSCAN
int capacity()
int nscan()
int size()
boolean isEmpty()
boolean isFull()
boolean add(T ref)
ref
- The reference to be added.boolean evict()
HardReferenceQueueEvictionListener
void 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()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.