Package org.eclipse.cdt.core.parser
Class CodeReaderCache
- java.lang.Object
-
- org.eclipse.cdt.core.parser.CodeReaderCache
-
- All Implemented Interfaces:
ICodeReaderCache
@Deprecated public class CodeReaderCache extends Object implements ICodeReaderCache
Deprecated.This is the CodeReaderBuffer used to cache CodeReaders for the ICodeReaderFactory when working with saved copies (primarily SavedCodeReaderFactory).- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CODE_READER_BUFFER
Deprecated.The string used to identify this CodeReaderCache.static int
DEFAULT_CACHE_SIZE_IN_MB
Deprecated.The default size of the cache in MB.static String
DEFAULT_CACHE_SIZE_IN_MB_STRING
Deprecated.A String value of the default size of the cache.
-
Constructor Summary
Constructors Constructor Description CodeReaderCache(int size)
Deprecated.Creates a CodeReaderCache and sets the size of the CodeReaderCache in MB.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
finalize()
Deprecated.void
flush()
Deprecated.CodeReader
get(String key)
Deprecated.Get a CodeReader from the cache.CodeReader
get(String key, IIndexFileLocation ifl)
Deprecated.Retrieves the CodeReader corresponding to the key specified that represents the path for that CodeReader.int
getCurrentSpace()
Deprecated.Returns the current size of the cache.CodeReader
remove(String key)
Deprecated.Removes the CodeReader from the cache corresponding to the path specified by the key and returns the CodeReader that was removed.void
setCacheSize(int size)
Deprecated.Sets the max cache size of this cache in terms of MB.
-
-
-
Field Detail
-
CODE_READER_BUFFER
public static final String CODE_READER_BUFFER
Deprecated.The string used to identify this CodeReaderCache. Mainly used for preferences.- See Also:
- Constant Field Values
-
DEFAULT_CACHE_SIZE_IN_MB
public static final int DEFAULT_CACHE_SIZE_IN_MB
Deprecated.The default size of the cache in MB.- See Also:
- Constant Field Values
-
DEFAULT_CACHE_SIZE_IN_MB_STRING
public static final String DEFAULT_CACHE_SIZE_IN_MB_STRING
Deprecated.A String value of the default size of the cache.
-
-
Constructor Detail
-
CodeReaderCache
public CodeReaderCache(int size)
Deprecated.Creates a CodeReaderCache and sets the size of the CodeReaderCache in MB. Creating a new CodeReaderCache also adds an UpdateCodeReaderCacheListener to the workspace so that when a resource is changed then the CodeReader for that resource is removed from this cache.- Parameters:
size
- initial size of the CodeReaderCache in terms of MB
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
Deprecated.
-
get
public CodeReader get(String key)
Deprecated.Get a CodeReader from the cache. The key is the char[] filename of the CodeReader to retrieve.- Specified by:
get
in interfaceICodeReaderCache
- Parameters:
key
- the path of the CodeReader to retrieve- Returns:
- the CodeReader corresponding to the path specified by the key
-
get
public CodeReader get(String key, IIndexFileLocation ifl) throws org.eclipse.core.runtime.CoreException, IOException
Deprecated.Description copied from interface:ICodeReaderCache
Retrieves the CodeReader corresponding to the key specified that represents the path for that CodeReader. If no CodeReader is found in the cache then a new CodeReader is created for the ifl and then returned.- Specified by:
get
in interfaceICodeReaderCache
- Parameters:
key
- the path corresponding to the CodeReader, generally: fileToParse.getLocation().toOSString()- Returns:
- the CodeReader corresponding to the path specified by the key
- Throws:
IOException
org.eclipse.core.runtime.CoreException
- Since:
- 5.1
-
setCacheSize
public void setCacheSize(int size)
Deprecated.Sets the max cache size of this cache in terms of MB.- Parameters:
size
-
-
remove
public CodeReader remove(String key)
Deprecated.Removes the CodeReader from the cache corresponding to the path specified by the key and returns the CodeReader that was removed. If no CodeReader is removed then null is returned.- Specified by:
remove
in interfaceICodeReaderCache
- Parameters:
key
-- Returns:
- the removed CodeReader or null if not found
-
getCurrentSpace
public int getCurrentSpace()
Deprecated.Returns the current size of the cache. For the CodeReaderCache this is in MB.- Specified by:
getCurrentSpace
in interfaceICodeReaderCache
-
flush
public void flush()
Deprecated.- Specified by:
flush
in interfaceICodeReaderCache
-
-