Package com._1c.g5.v8.dt.bm.xtext
Class XtextBmLinkProvider.UriResourceContainerCache
- java.lang.Object
-
- com._1c.g5.v8.dt.bm.xtext.XtextBmLinkProvider.UriResourceContainerCache
-
- Enclosing class:
- XtextBmLinkProvider
public abstract static class XtextBmLinkProvider.UriResourceContainerCache extends Object
Special container for link provider resources. This class provides special behavior for caching elements:- If cache contains more then
getMaxCacheSize()
elements - methodsremoveNonUsingResource()
will be called. It deletes all resources with minimal value ofXtextBmLinkProvider.UriResourceContainerCache.CacheItem.computeUtility()
- Number of deleting items is defined by
removeItemFactor()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
XtextBmLinkProvider.UriResourceContainerCache.CacheItem
Special class representing element of cache
-
Constructor Summary
Constructors Constructor Description UriResourceContainerCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Deletes all items from cacheorg.eclipse.emf.ecore.resource.Resource
get(org.eclipse.emf.common.util.URI uri)
Gets caching element from the cache byURI
int
getMaxCacheSize()
Gets max count of elements in the cacheprotected abstract int
getUriWeight(org.eclipse.emf.common.util.URI uri)
Gets weight of cache element byURI
void
put(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.Resource resource)
Add elements to the cachevoid
putUpdateUri(org.eclipse.emf.common.util.URI uri, org.eclipse.emf.ecore.resource.Resource resource)
Add elements to the cache corresponding to the updating operationorg.eclipse.emf.ecore.resource.Resource
remove(org.eclipse.emf.common.util.URI uri)
Removes element from the cache byURI
double
removeItemFactor()
Gets special number defining number of elements to deleting fromgetMaxCacheSize()
void
removeNonUsingResource()
Removes non using elements from the cache
-
-
-
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 fromgetMaxCacheSize()
- 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 benull
resource
- caching element, can't benull
-
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 benull
resource
- caching element, cannot benull
-
get
public org.eclipse.emf.ecore.resource.Resource get(org.eclipse.emf.common.util.URI uri)
Gets caching element from the cache byURI
- Parameters:
uri
-URI
for getting element from the cache, can't benull
- Returns:
- caching element or
null
if there is no element with suchURI
-
remove
public org.eclipse.emf.ecore.resource.Resource remove(org.eclipse.emf.common.util.URI uri)
Removes element from the cache byURI
- Parameters:
uri
-URI
for deleting element, can't benull
- 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 byURI
- Parameters:
uri
-URI
for determinate the weight of caching element, can't benull
- Returns:
- weight of cache element
-
-