Class LanguageSettingsStorage

java.lang.Object
org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage
All Implemented Interfaces:
Cloneable

public class LanguageSettingsStorage extends Object implements Cloneable
The class representing the (in-memory) storage for language settings entries ICLanguageSettingEntry.
Since:
5.4
  • Field Details

  • Constructor Details

    • LanguageSettingsStorage

      public LanguageSettingsStorage()
  • Method Details

    • getSettingEntries

      public List<ICLanguageSettingEntry> getSettingEntries(String rcProjectPath, String languageId)
      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 null if 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. If null the entries are considered to be being defined as default entries for resources.
      languageId - - language id. If null, then entries are considered to be defined for the language scope.
      entries - - language settings entries to set.
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if the storage is empty or false otherwise.
    • clear

      public void clear()
      Clear all the entries for all resources and all languages.
    • getLanguages

      public Set<String> 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

      public Set<String> getResourcePaths(String languageId)
      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

      public static List<ICLanguageSettingEntry> getPooledList(List<ICLanguageSettingEntry> entries)
      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

      public static List<ICLanguageSettingEntry> 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:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object