From 791d78bc64def507b84ec4f0b12512182c53ee1d Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Tue, 3 Jul 2007 08:21:00 +0000 Subject: [PATCH] Added another Constructor for convience that just takes the maximum number of cached items as a parameter git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@552726 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/util/LRUCache.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java b/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java index 612ca8466b..dd8cd5313d 100755 --- a/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java +++ b/activemq-core/src/main/java/org/apache/activemq/util/LRUCache.java @@ -23,6 +23,8 @@ import java.util.Map; * A Simple LRU Cache * * @version $Revision$ + * @param + * @param */ public class LRUCache extends LinkedHashMap { @@ -31,13 +33,21 @@ public class LRUCache extends LinkedHashMap { /** - * 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 LRUCache instance with the * specified initial capacity, maximumCacheSize,load factor and ordering mode.