KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > cache > mru > MRUCache


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.cache.mru;
19
20 import org.sape.carbon.services.cache.Cache;
21
22 /**
23  * <p>This interface represents caches that hold a limited number of items
24  * and remove older items or items that haven't been accessed in a while
25  * to make room for new items. MRU stands for Most Recently Used and refers to
26  * the algorithm where by the item used the longest ago is the item to be
27  * removed for new items. This cache primarily acts the same as other caches,
28  * but also provides information about its hit ratio that other caches do
29  * not provide.</p>
30  *
31  * @since carbon 1.0
32  * @author Greg Hinkle, January 2002
33  * @version $Revision: 1.8 $($Author: dvoet $ / $Date: 2003/05/05 21:21:07 $)
34  * <br>Copyright 2002 Sapient
35  */

36 public interface MRUCache extends Cache {
37
38
39     /**
40      * The count of times an item was looked up and was in the cache.
41      * @return the count of hits to this cache
42      */

43     Long JavaDoc getHits();
44
45     /**
46      * The count of times an item was looked up and was not in the cache.
47      * @return the number of cache misses
48      */

49     Long JavaDoc getMisses();
50
51     /**
52      * The percentage of cache lookups that resulted in the item being found.
53      * @return the percentage of hits to misses
54      */

55     Float JavaDoc getHitPercentage();
56
57     /**
58      * The count of items currently in the cache.
59      * @return the number of items in the cache
60      */

61     Long JavaDoc getSize();
62
63 }
64
Popular Tags