src/main/java/org/jboss/util/LRUCachePolicy.java
/**
       * Removes from the cache list the specified entry.
       * @param entry 
       */
Removes from the cache list the specified entry.
@param entry
Removes from the cache list the specified entry . @param entry
protected void remove(LRUCacheEntry entry)
      {
         if (entry == null) {throw new IllegalArgumentException("Cannot remove a null entry from the cache");}
         if (m_count < 1) {throw new IllegalStateException("Trying to remove an entry from an empty cache");}
         entry.m_key = entry.m_object = null;
         if (m_count == 1)
         {
            m_head = m_tail = null;
         }
         else
         {
            if (entry.m_prev == null) 
            {
               m_head = entry.m_next;
               m_head.m_prev = null;
               entry.m_next = null;
            }
            else if (entry.m_next == null) 
            {
               m_tail = entry.m_prev;
               m_tail.m_next = null;
               entry.m_prev = null;
            }
            else 
            {
               entry.m_next.m_prev = entry.m_prev;
               entry.m_prev.m_next = entry.m_next;
               entry.m_prev = null;
               entry.m_next = null;
            }
         }
         --m_count;
         entryRemoved(entry);
      }
protected void remove ( LRUCacheEntry entry ) { if ( entry == null ) { throw new IllegalArgumentException ( "Cannot remove a null entry from the cache" ) ; } if ( m_count < 1 ) { throw new IllegalStateException ( "Trying to remove an entry from an empty cache" ) ; } entry . m_key = entry . m_object = null ; if ( m_count == 1 ) { m_head = m_tail = null ; } else { if ( entry . m_prev == null ) { m_head = entry . m_next ; m_head . m_prev = null ; entry . m_next = null ; } else if ( entry . m_next == null ) { m_tail = entry . m_prev ; m_tail . m_next = null ; entry . m_prev = null ; } else { entry . m_next . m_prev = entry . m_prev ; entry . m_prev . m_next = entry . m_next ; entry . m_prev = null ; entry . m_next = null ; } } -- m_count ; entryRemoved ( entry ) ; }
Removes from the cache list the specified entry.
Removes from the cache list the specified entry .
// the head // the tail // in the middle