KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > expressions > PropertyCache


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.expressions;
12
13 import org.eclipse.core.internal.expressions.util.LRUCache;
14
15 /* package */ class PropertyCache {
16     
17     private LRUCache fCache;
18     
19     public PropertyCache(final int cacheSize) {
20         fCache= new LRUCache(100);
21         fCache.setSpaceLimit(cacheSize);
22     }
23     
24     public Property get(Property key) {
25         return (Property)fCache.get(key);
26     }
27     
28     public void put(Property method) {
29         fCache.put(method, method);
30     }
31     
32     public void remove(Property method) {
33         fCache.removeKey(method);
34     }
35 }
36
Popular Tags