001 /*--------------------------------------------------------------------------+
002 $Id: SoftRefStraightCacheBase.java 26268 2010-02-18 10:44:30Z juergens $
003 | |
004 | Copyright 2005-2010 Technische Universitaet Muenchen |
005 | |
006 | Licensed under the Apache License, Version 2.0 (the "License"); |
007 | you may not use this file except in compliance with the License. |
008 | You may obtain a copy of the License at |
009 | |
010 | http://www.apache.org/licenses/LICENSE-2.0 |
011 | |
012 | Unless required by applicable law or agreed to in writing, software |
013 | distributed under the License is distributed on an "AS IS" BASIS, |
014 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
015 | See the License for the specific language governing permissions and |
016 | limitations under the License. |
017 +--------------------------------------------------------------------------*/
018 package edu.tum.cs.commons.cache;
019
020 import edu.tum.cs.commons.error.NeverThrownRuntimeException;
021
022 /**
023 * This a special base class for caches that work with identifiers that are
024 * suitable as hash keys.
025 *
026 * @author Florian Deissenboeck
027 * @author $Author: juergens $
028 *
029 * @version $Rev: 26268 $
030 * @levd.rating GREEN Hash: E85AF211BBB7DB2E0594B7C6F81453CC
031 *
032 * @param <I>
033 * the index type of the cache
034 * @param <E>
035 * the type stored in the cache
036 * @param <X>
037 * the type of exception thrown by the {@link #obtainItem(Object)}
038 * method. Use the {@link NeverThrownRuntimeException} if no
039 * exception will be thrown.
040 */
041 public abstract class SoftRefStraightCacheBase<I, E, X extends Exception>
042 extends SoftRefCacheBase<I, I, E, X> {
043
044 /**
045 * This method simply returns the identifier.
046 */
047 @Override
048 protected I getHashKey(I identifier) {
049 return identifier;
050 }
051
052 }