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 StringCODE_READER_BUFFERDeprecated.The string used to identify this CodeReaderCache.static intDEFAULT_CACHE_SIZE_IN_MBDeprecated.The default size of the cache in MB.static StringDEFAULT_CACHE_SIZE_IN_MB_STRINGDeprecated.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 voidfinalize()Deprecated.voidflush()Deprecated.CodeReaderget(String key)Deprecated.Get a CodeReader from the cache.CodeReaderget(String key, IIndexFileLocation ifl)Deprecated.Retrieves the CodeReader corresponding to the key specified that represents the path for that CodeReader.intgetCurrentSpace()Deprecated.Returns the current size of the cache.CodeReaderremove(String key)Deprecated.Removes the CodeReader from the cache corresponding to the path specified by the key and returns the CodeReader that was removed.voidsetCacheSize(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 ThrowableDeprecated.
-
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:
getin 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:ICodeReaderCacheRetrieves 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:
getin 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:
IOExceptionorg.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:
removein 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:
getCurrentSpacein interfaceICodeReaderCache
-
flush
public void flush()
Deprecated.- Specified by:
flushin interfaceICodeReaderCache
-
-