KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > medor > eval > cache > api > CollectionCache


1 /**
2  * MEDOR: Middleware Enabling Distributed Object Requests
3  *
4  * Copyright (C) 2001-2003 France Telecom R&D
5  * Contact: alexandre.lefebvre@rd.francetelecom.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  * Initial developers: M. Alia, A. Lefebvre
22  */

23
24 package org.objectweb.medor.eval.cache.api;
25
26 import org.objectweb.medor.api.MedorException;
27 import org.objectweb.medor.tuple.api.Tuple;
28
29 import java.util.Iterator JavaDoc;
30
31 /**
32  * This interface represents a cache for TupleCollection objets.
33  */

34 public interface CollectionCache {
35
36     /**
37      * Are insertions possible (is policy dependent: example may require
38      * to free the cache before insertion).
39      */

40     boolean isCanInsert();
41
42     /**
43      * This method allow stop or no inserting objetcs in the cache.
44      */

45     void setCanInsert(boolean canInsert);
46
47     /**
48      * @param tupleIndex is the rank of the Object
49      */

50     Tuple getTuple(int tupleIndex) throws MedorException;
51
52     boolean putTuple(int indexTuple, Tuple t) throws MedorException;
53
54     /**
55      * Does the cache contains Object ranked int of the associated
56      * Objects to be cached.
57      */

58     boolean contains(int index);
59
60     long getCapacity();
61
62     /**
63      * Creates the internal structure of the cache.
64      */

65     void initialize();
66
67     /**
68      * Returns an iterator over the indexes of the Objects which are present
69      * in the cache.
70      */

71     Iterator JavaDoc tupleIndexIterator();
72
73     /**
74      * Reinitializes the internal structure of the cache.
75      */

76     //TODO renommer en reset.
77
void destroy();
78
79 }
80
Popular Tags