KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > controller > cache > Cache


1 /**
2  * Copyright 2003-2006 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6
7        http://www.apache.org/licenses/LICENSE-2.0
8
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */

15
16 package com.jdon.controller.cache;
17
18 /**
19  * Cache interface
20  * A Cache object is responsible for managing a collection of cached objects
21  * Given an ObjectKey object, a Cache object quickly finds the corresponding cached object.
22  * The Cache-Manager object passes an ObjectKey object to the Cache object’s fetchObject
23  * method to get a cached object from the cache
24  *
25  * <p>@author <a HREF="mailto:banqiao@jdon.com">banq</a></p>
26  */

27 public interface Cache {
28   public Object JavaDoc get(Object JavaDoc key);
29
30   public void put(Object JavaDoc key, Object JavaDoc value);
31
32   public void remove(Object JavaDoc key);
33
34   public long size();
35
36   public void clear();
37
38   public boolean contain(Object JavaDoc key);
39
40 }
41
Popular Tags