Class LanguageSettingsStorage
java.lang.Object
org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage
- All Implemented Interfaces:
Cloneable
The class representing the (in-memory) storage for language settings entries
ICLanguageSettingEntry.- Since:
- 5.4
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all the entries for all resources and all languages.clone()Clone storage for the entries.booleanstatic List<ICLanguageSettingEntry> static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries) Find and return the equal list of entries from the pool to conserve the memory.getResourcePaths(String languageId) Returns set of paths for all resources associated with entries for given language.getSettingEntries(String rcProjectPath, String languageId) Returns the list of setting entries for the given resource and language.inthashCode()booleanisEmpty()voidsetSettingEntries(String rcProjectPath, String languageId, List<? extends ICLanguageSettingEntry> entries) Sets language settings entries for the resource and language.
-
Field Details
-
fStorage
Storage to keep settings entries.
-
-
Constructor Details
-
LanguageSettingsStorage
public LanguageSettingsStorage()
-
-
Method Details
-
getSettingEntries
Returns the list of setting entries for the given resource and language.
Note that this list is unmodifiable.- Parameters:
rcProjectPath- - path to the resource relative to the project.languageId- - language id.- Returns:
- the list of setting entries or
nullif no settings defined.
-
setSettingEntries
public void setSettingEntries(String rcProjectPath, String languageId, List<? extends ICLanguageSettingEntry> entries) Sets language settings entries for the resource and language.- Parameters:
rcProjectPath- - path to the resource relative to the project. Ifnullthe entries are considered to be being defined as default entries for resources.languageId- - language id. Ifnull, then entries are considered to be defined for the language scope.entries- - language settings entries to set.
-
isEmpty
public boolean isEmpty()- Returns:
trueif the storage is empty orfalseotherwise.
-
clear
public void clear()Clear all the entries for all resources and all languages. -
getLanguages
- Returns:
- set of all languages associated with the entries.
Note that the storage can keep default entries for the language scope
of the provider, so the set can contain
null.
-
getResourcePaths
Returns set of paths for all resources associated with entries for given language. The paths are project relative.- Parameters:
languageId- - language ID.- Returns:
- the set of resource paths associated with entries for the given language or empty set.
Note that the storage can keep default entries for resources, so the set can contain
null.
-
getPooledList
Find and return the equal list of entries from the pool to conserve the memory.- Parameters:
entries- - list of entries to pool.- Returns:
- returns the list of entries from the pool.
-
getPooledEmptyList
- Returns:
- Returns the empty immutable list which is pooled. Use this call rather than creating new empty array to ensure that faster shallow operator '==' can be used instead of equals() which goes deep on HashMaps.
-
clone
Clone storage for the entries. Copies references for lists of entries as a whole. Note that that is OK as the lists kept in storage are unmodifiable and pooled.- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
hashCode
public int hashCode() -
equals
-