Class XtextBmLinkProvider.UriResourceContainerCache

    • Constructor Detail

      • UriResourceContainerCache

        public UriResourceContainerCache()
    • Method Detail

      • removeNonUsingResource

        public void removeNonUsingResource()
        Removes non using elements from the cache
      • removeItemFactor

        public double removeItemFactor()
        Gets special number defining number of elements to deleting from getMaxCacheSize()
        Returns:
        special number defining number of elements to deleting from getMaxCacheSize()
      • getMaxCacheSize

        public int getMaxCacheSize()
        Gets max count of elements in the cache
        Returns:
        max count of elements in the cache
      • put

        public void put​(org.eclipse.emf.common.util.URI uri,
                        org.eclipse.emf.ecore.resource.Resource resource)
        Add elements to the cache
        Parameters:
        uri - URI of the link provider resource, can't be null
        resource - caching element, can't be null
      • putUpdateUri

        public void putUpdateUri​(org.eclipse.emf.common.util.URI uri,
                                 org.eclipse.emf.ecore.resource.Resource resource)
        Add elements to the cache corresponding to the updating operation
        Parameters:
        uri - URI of the link provider resource, cannot be null
        resource - caching element, cannot be null
      • get

        public org.eclipse.emf.ecore.resource.Resource get​(org.eclipse.emf.common.util.URI uri)
        Gets caching element from the cache by URI
        Parameters:
        uri - URI for getting element from the cache, can't be null
        Returns:
        caching element or null if there is no element with such URI
      • remove

        public org.eclipse.emf.ecore.resource.Resource remove​(org.eclipse.emf.common.util.URI uri)
        Removes element from the cache by URI
        Parameters:
        uri - URI for deleting element, can't be null
        Returns:
        element from the cache if it was successfully deleted or null otherwise
      • clear

        public void clear()
        Deletes all items from cache
      • getUriWeight

        protected abstract int getUriWeight​(org.eclipse.emf.common.util.URI uri)
        Gets weight of cache element by URI
        Parameters:
        uri - URI for determinate the weight of caching element, can't be null
        Returns:
        weight of cache element