You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2007/07/03 10:21:01 UTC

svn commit: r552726 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java

Author: rajdavies
Date: Tue Jul  3 01:21:00 2007
New Revision: 552726

URL: http://svn.apache.org/viewvc?view=rev&rev=552726
Log:
Added another Constructor for convience that just takes the maximum number of cached items as a parameter

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java?view=diff&rev=552726&r1=552725&r2=552726
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java Tue Jul  3 01:21:00 2007
@@ -23,6 +23,8 @@
  * A Simple LRU Cache
  * 
  * @version $Revision$
+ * @param <K> 
+ * @param <V> 
  */
 
 public class LRUCache<K, V> extends LinkedHashMap<K, V> {
@@ -31,13 +33,21 @@
 
     
     /**
-     * Constructs LRU Cache
+     * Default constructorfor an LRU Cache
+     * The default capacity is 10000
      * 
      */
     public LRUCache(){
         super(1000,0.75f,true);
     }
     
+    /**
+     * Constructs a LRUCache with a maximum capacity
+     * @param maximumCacheSize
+     */
+    public LRUCache(int maximumCacheSize) {
+        this(maximumCacheSize,maximumCacheSize,0.75f,true);
+    }
     /**
      * Constructs an empty <tt>LRUCache</tt> instance with the
      * specified initial capacity, maximumCacheSize,load factor and ordering mode.