KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nemesis > forum > util > cache > Cacheable


1 /*
2  * NEMESIS-FORUM.
3  * Copyright (C) 2002 David Laurent(lithium2@free.fr). All rights reserved.
4  *
5  * Copyright (c) 2000 The Apache Software Foundation. All rights reserved.
6  *
7  * Copyright (C) 2001 Yasna.com. All rights reserved.
8  *
9  * Copyright (C) 2000 CoolServlets.com. All rights reserved.
10  *
11  * NEMESIS-FORUM. is free software; you can redistribute it and/or
12  * modify it under the terms of the Apache Software License, Version 1.1,
13  * or (at your option) any later version.
14  *
15  * NEMESIS-FORUM core framework, NEMESIS-FORUM backoffice, NEMESIS-FORUM frontoffice
16  * application are parts of NEMESIS-FORUM and are distributed under
17  * same terms of licence.
18  *
19  *
20  * NEMESIS-FORUM includes software developed by the Apache Software Foundation (http://www.apache.org/)
21  * and software developed by CoolServlets.com (http://www.coolservlets.com).
22  * and software developed by Yasna.com (http://www.yasna.com).
23  *
24  */

25
26 package org.nemesis.forum.util.cache;
27
28 /**
29  * Interface that defines the necessary behavior for objects added to a Cache.
30  * Objects only need to know how big they are (in bytes). That size
31  * should be considered to be a best estimate of how much memory the Object
32  * occupies and may be based on empirical trials or dynamic calculations.<p>
33  *
34  * While the accuracy of the size calculation is important, care should be
35  * taken to minimize the computation time so that cache operations are
36  * speedy.
37  *
38  * @see Cache
39  */

40 public interface Cacheable {
41
42     /**
43      * Returns the approximate size of the Object in bytes. The size should be
44      * considered to be a best estimate of how much memory the Object occupies
45      * and may be based on empirical trials or dynamic calculations.<p>
46      *
47      * @return the size of the Object in bytes.
48      */

49     public int getSize();
50 }
51
Popular Tags