Class BmCachingTreeFilter
java.lang.Object
com._1c.g5.v8.dt.navigator.filters.TreeItemFilter
com._1c.g5.v8.dt.navigator.filters.BmCachingTreeFilter
- Direct Known Subclasses:
BmPresentTreeFilter
,ContainmentTreeFilter.Absent
,ContainmentTreeFilter.Present
Tree filter with caching and cache invalidation support.
-
Constructor Summary
ConstructorsConstructorDescriptionBmCachingTreeFilter
(IBmModel model, boolean recursive) Instantiates a new BM caching tree filter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this tree item filter.protected final IBmModel
Returns the BM model.protected <T,
K> T getCached
(K key, com.google.common.base.Function<K, T> generator) Returns the cached value bykey
, calls thegenerator
to compute the value if it is not cached yet.protected final void
invalidateOn
(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature... features) Tells this filter to invalidate the cached value at theobject
key, if one of the givenfeatures
of theobject
is changed.protected final void
invalidateOn
(org.eclipse.emf.ecore.EStructuralFeature... features) Tells this filter to fully invalidate the cache if one of the providedfeatures
is changed in the context of the associatedIBmModel
.Methods inherited from class com._1c.g5.v8.dt.navigator.filters.TreeItemFilter
isRecursive, keep
-
Constructor Details
-
BmCachingTreeFilter
Instantiates a new BM caching tree filter.- Parameters:
model
- the model to listen to BM-events on.recursive
- the recursive flag. SeeTreeFilter#TreeFilter(boolean)
.
-
-
Method Details
-
dispose
public void dispose()Description copied from class:TreeItemFilter
Disposes this tree item filter.- Overrides:
dispose
in classTreeItemFilter
-
getCached
protected <T,K> T getCached(K key, com.google.common.base.Function<K, T> generator) Returns the cached value bykey
, calls thegenerator
to compute the value if it is not cached yet.- Parameters:
key
- the cache lookup key.generator
- the generatorFunction
.- Returns:
-
invalidateOn
protected final void invalidateOn(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature... features) Tells this filter to invalidate the cached value at theobject
key, if one of the givenfeatures
of theobject
is changed.- Parameters:
object
- the object to monitor features of, also acts as the cache key.features
- the features to monitor.
-
invalidateOn
protected final void invalidateOn(org.eclipse.emf.ecore.EStructuralFeature... features) Tells this filter to fully invalidate the cache if one of the providedfeatures
is changed in the context of the associatedIBmModel
.- Parameters:
features
- the features to monitor.
-
getBmModel
Returns the BM model.- Returns:
- the BM model, never
null
.
-