~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ICodeReaderCache.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2005, 2009 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.cdt.core.parser;
12
 
 
13
 
import java.io.IOException;
14
 
 
15
 
import org.eclipse.cdt.core.index.IIndexFileLocation;
16
 
import org.eclipse.core.runtime.CoreException;
17
 
 
18
 
/**
19
 
 * This is the interface to a cache for CodeReaders.
20
 
 * 
21
 
 * For thread safety the implementations of this interface must ensure that their methods are thread safe. 
22
 
 * 
23
 
 * @noextend This interface is not intended to be extended by clients.
24
 
 * @noimplement This interface is not intended to be implemented by clients.
25
 
 */
26
 
public interface ICodeReaderCache {
27
 
 
28
 
        /**
29
 
         * Retrieves the CodeReader corresponding to the key specified that represents the 
30
 
         * path for that CodeReader.  If no CodeReader is found in the cache then a new CodeReader
31
 
         * is created for the path and then returned.
32
 
         * 
33
 
         * @param key the path corresponding to the CodeReader, generally: 
34
 
         * fileToParse.getLocation().toOSString()
35
 
         * @return the CodeReader corresponding to the path specified by the key
36
 
         */
37
 
        public CodeReader get(String key);
38
 
        
39
 
        /**
40
 
         * Retrieves the CodeReader corresponding to the key specified that represents the 
41
 
         * path for that CodeReader.  If no CodeReader is found in the cache then a new CodeReader
42
 
         * is created for the ifl and then returned.
43
 
         * 
44
 
         * @param key the path corresponding to the CodeReader, generally: 
45
 
         * fileToParse.getLocation().toOSString()
46
 
         * @return the CodeReader corresponding to the path specified by the key
47
 
         * @throws IOException 
48
 
         * @throws CoreException 
49
 
         * @since 5.1
50
 
         */
51
 
        public CodeReader get(String key, IIndexFileLocation ifl) throws CoreException, IOException;
52
 
 
53
 
        /**
54
 
         * Used to remove the CodeReader corresponding to the path specified by key from the cache.
55
 
         * 
56
 
         * @param key the path of the CodeReader to be removed
57
 
         * @return the removed CodeReader or null if not found
58
 
         */
59
 
        public CodeReader remove(String key);
60
 
 
61
 
        /**
62
 
         * Returns the amount of space that the cache is using.
63
 
         * The units are relative to the implementation of the cache.  It could be
64
 
         * the total number of objects in the cache, or the total space the cache is 
65
 
         * using in MB.
66
 
         */
67
 
        public int getCurrentSpace();
68
 
 
69
 
        /**
70
 
         * 
71
 
         */
72
 
        public void flush();
73
 
}