From 9da41c78e6e37fff9e177acd2509ac5a7496ac35 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 12 Sep 2002 17:20:52 +0000 Subject: [PATCH] Implemented utility method containsKeys(Object[]) to let us check which of an array of keys are present in the CacheMap. This is used by Node.prefetchChildren() to get only those child nodes which aren't in the cache already. --- src/helma/util/CacheMap.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/helma/util/CacheMap.java b/src/helma/util/CacheMap.java index 97d52e93..f9751a73 100644 --- a/src/helma/util/CacheMap.java +++ b/src/helma/util/CacheMap.java @@ -146,7 +146,29 @@ public class CacheMap { return false; } - /// Gets the object associated with the specified key in the + /// Returns the number of keys in object array keys that + // were not found in the Map. + // Those keys that are contained in the Map are nulled out in the array. + // @param keys an array of key objects we are looking for + // @see LruHashtable#contains + public synchronized int containsKeys (Object[] keys) { + int notfound = 0; + for (int i=0; i