public class LRUCachePolicy.LRUList extends Object
Modifier and Type | Field and Description |
---|---|
int |
m_cacheMiss
The cache misses happened
|
int |
m_capacity
The current capacity of the cache list
|
int |
m_count
The number of cached objects
|
LRUCachePolicy.LRUCacheEntry |
m_head
The head of the double linked list
|
int |
m_maxCapacity
The maximum capacity of the cache list
|
int |
m_minCapacity
The minimum capacity of the cache list
|
LRUCachePolicy.LRUCacheEntry |
m_tail
The tail of the double linked list
|
Modifier | Constructor and Description |
---|---|
protected |
LRUList()
Creates a new double queued list.
|
Modifier and Type | Method and Description |
---|---|
protected void |
capacityChanged(int oldCapacity)
Callback that signals that the capacity of the cache is changed.
|
protected void |
clear() |
protected void |
demote()
Demotes from the cache the least used entry.
|
protected void |
entryAdded(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry has been added to the cache.
|
protected void |
entryPromotion(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry is just about to be added.
|
protected void |
entryRemoved(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry has been removed from the cache.
|
protected void |
promote(LRUCachePolicy.LRUCacheEntry entry)
Promotes the cache entry
entry to the last used position
of the list. |
protected void |
remove(LRUCachePolicy.LRUCacheEntry entry)
Removes from the cache list the specified entry.
|
String |
toString() |
public int m_maxCapacity
public int m_minCapacity
public int m_capacity
public int m_count
public LRUCachePolicy.LRUCacheEntry m_head
public LRUCachePolicy.LRUCacheEntry m_tail
public int m_cacheMiss
protected void promote(LRUCachePolicy.LRUCacheEntry entry)
entry
to the last used position
of the list. entry
- the object to be promoted, cannot be nullIllegalStateException
- if this method is called with a full cachedemote()
protected void demote()
protected void remove(LRUCachePolicy.LRUCacheEntry entry)
entry
- protected void entryPromotion(LRUCachePolicy.LRUCacheEntry entry)
entry
- protected void entryAdded(LRUCachePolicy.LRUCacheEntry entry)
entry
- protected void entryRemoved(LRUCachePolicy.LRUCacheEntry entry)
entry
- protected void capacityChanged(int oldCapacity)
oldCapacity
- the capacity before the change happenedprotected void clear()
Copyright © 2018 JBoss by Red Hat. All rights reserved.