Class LRUCachePolicy.LRUList

  • Enclosing class:
    LRUCachePolicy

    public class LRUCachePolicy.LRUList
    extends java.lang.Object
    Double queued list used to store cache entries.
    • Field Detail

      • m_maxCapacity

        public int m_maxCapacity
        The maximum capacity of the cache list
      • m_minCapacity

        public int m_minCapacity
        The minimum capacity of the cache list
      • m_capacity

        public int m_capacity
        The current capacity of the cache list
      • m_count

        public int m_count
        The number of cached objects
      • m_cacheMiss

        public int m_cacheMiss
        The cache misses happened
    • Constructor Detail

      • LRUList

        protected LRUList()
        Creates a new double queued list.
    • Method Detail

      • promote

        protected void promote​(LRUCachePolicy.LRUCacheEntry entry)
        Promotes the cache entry entry to the last used position of the list.
        If the object is already there, does nothing.
        Parameters:
        entry - the object to be promoted, cannot be null
        Throws:
        java.lang.IllegalStateException - if this method is called with a full cache
        See Also:
        demote()
      • remove

        protected void remove​(LRUCachePolicy.LRUCacheEntry entry)
        Removes from the cache list the specified entry.
        Parameters:
        entry -
      • entryPromotion

        protected void entryPromotion​(LRUCachePolicy.LRUCacheEntry entry)
        Callback that signals that the given entry is just about to be added.
        Parameters:
        entry -
      • entryAdded

        protected void entryAdded​(LRUCachePolicy.LRUCacheEntry entry)
        Callback that signals that the given entry has been added to the cache.
        Parameters:
        entry -
      • entryRemoved

        protected void entryRemoved​(LRUCachePolicy.LRUCacheEntry entry)
        Callback that signals that the given entry has been removed from the cache.
        Parameters:
        entry -
      • capacityChanged

        protected void capacityChanged​(int oldCapacity)
        Callback that signals that the capacity of the cache is changed.
        Parameters:
        oldCapacity - the capacity before the change happened
      • clear

        protected void clear()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object