activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r552726 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java
Date Tue, 03 Jul 2007 08:21:01 GMT
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.



Mime
View raw message