Package org.eclipse.cdt.core.parser
Class CodeReaderCache
java.lang.Object
org.eclipse.cdt.core.parser.CodeReaderCache
- All Implemented Interfaces:
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
-
Constructor Summary
ConstructorDescriptionCodeReaderCache
(int size) Deprecated.Creates a CodeReaderCache and sets the size of the CodeReaderCache in MB. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
Deprecated.void
flush()
Deprecated.Deprecated.Get a CodeReader from the cache.get
(String key, IIndexFileLocation ifl) Deprecated.Retrieves the CodeReader corresponding to the key specified that represents the path for that CodeReader.int
Deprecated.Returns the current size of the cache.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 Details
-
CODE_READER_BUFFER
Deprecated.The string used to identify this CodeReaderCache. Mainly used for preferences.- See Also:
-
DEFAULT_CACHE_SIZE_IN_MB
public static final int DEFAULT_CACHE_SIZE_IN_MBDeprecated.The default size of the cache in MB.- See Also:
-
DEFAULT_CACHE_SIZE_IN_MB_STRING
Deprecated.A String value of the default size of the cache.
-
-
Constructor Details
-
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 Details
-
finalize
Deprecated. -
get
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
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
-