KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > cache > Cacheable


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.cache;
5
6 import com.tc.object.ObjectID;
7
8 import gnu.trove.TLinkable;
9
10 /**
11  * @author steve Interface for objects that can be stored in the cache
12  */

13 public interface Cacheable extends TLinkable {
14   public ObjectID getObjectID();
15
16   public void markAccessed();
17
18   public void clearAccessed();
19
20   public boolean recentlyAccessed();
21   
22   /*
23    * @param factor : factor by which accessCount to be reduced.
24    *
25    * @return accessCount after divided by factor
26    *
27    * throws ArithmeticException if factor=0
28    */

29   public int accessCount(int factor);
30   
31   // This method checks to see if the element is in a state where it can be evicted.
32
public boolean canEvict();
33   
34 }
Popular Tags