1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 * 9 * http://www.apache.org/licenses/LICENSE-2.010 * 11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */17packageorg.apache.jetspeed.cache.general;
1819import java.util.HashMap;
2021/***22 * <p>23 * SimpleHashMapCache24 * </p>25 * <p>26 *27 * </p>28 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>29 * @version $Id: SimpleHashMapCache.java 516448 2007-03-09 16:25:47Z ate $30 *31 */32publicclassSimpleHashMapCache implements GeneralCache
33 {
3435protected HashMap cache;
3637/***38 * 39 */40publicSimpleHashMapCache()
41 {
42super();
43 cache = new HashMap();
44 }
4546/***47 * <p>48 * get49 * </p>50 *51 * @see org.apache.jetspeed.cache.general.GeneralCache#get(java.lang.String)52 * @param key53 * @return54 */55public Object get( String key )
56 {
57return cache.get(key);
58 }
5960/***61 * <p>62 * put63 * </p>64 *65 * @see org.apache.jetspeed.cache.general.GeneralCache#put(java.lang.String, java.lang.Object)66 * @param key67 * @param value68 */69publicvoid put( String key, Object value )
70 {
71 cache.put(key, value);
7273 }
7475/***76 * <p>77 * contains78 * </p>79 *80 * @see org.apache.jetspeed.cache.general.GeneralCache#contains(java.lang.String)81 * @param key82 * @return83 */84publicboolean contains( String key )
85 {
86return cache.containsKey(key);
87 }
8889/***90 * <p>91 * remove92 * </p>93 *94 * @see org.apache.jetspeed.cache.general.GeneralCache#remove(java.lang.String)95 * @param key96 */97public Object remove( String key )
98 {
99return cache.remove(key);
100 }
101102 }