01: /*
02: * The contents of this file are subject to the Sapient Public License
03: * Version 1.0 (the "License"); you may not use this file except in compliance
04: * with the License. You may obtain a copy of the License at
05: * http://carbon.sf.net/License.html.
06: *
07: * Software distributed under the License is distributed on an "AS IS" basis,
08: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
09: * 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: * The count of times an item was looked up and was in the cache.
40: * @return the count of hits to this cache
41: */
42: Long getHits();
43:
44: /**
45: * The count of times an item was looked up and was not in the cache.
46: * @return the number of cache misses
47: */
48: Long getMisses();
49:
50: /**
51: * The percentage of cache lookups that resulted in the item being found.
52: * @return the percentage of hits to misses
53: */
54: Float getHitPercentage();
55:
56: /**
57: * The count of items currently in the cache.
58: * @return the number of items in the cache
59: */
60: Long getSize();
61:
62: }
|