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

public abstract class BmCachingTreeFilter extends TreeItemFilter
Tree filter with caching and cache invalidation support.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BmCachingTreeFilter(IBmModel model, boolean recursive)
    Instantiates a new BM caching tree filter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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 by key, calls the generator 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 the object key, if one of the given features of the object is changed.
    protected final void
    invalidateOn(org.eclipse.emf.ecore.EStructuralFeature... features)
    Tells this filter to fully invalidate the cache if one of the provided features is changed in the context of the associated IBmModel.

    Methods inherited from class com._1c.g5.v8.dt.navigator.filters.TreeItemFilter

    isRecursive, keep

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BmCachingTreeFilter

      public BmCachingTreeFilter(IBmModel model, boolean recursive)
      Instantiates a new BM caching tree filter.
      Parameters:
      model - the model to listen to BM-events on.
      recursive - the recursive flag. See TreeFilter#TreeFilter(boolean).
  • Method Details

    • dispose

      public void dispose()
      Description copied from class: TreeItemFilter
      Disposes this tree item filter.
      Overrides:
      dispose in class TreeItemFilter
    • getCached

      protected <T, K> T getCached(K key, com.google.common.base.Function<K,T> generator)
      Returns the cached value by key, calls the generator to compute the value if it is not cached yet.
      Parameters:
      key - the cache lookup key.
      generator - the generator Function.
      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 the object key, if one of the given features of the object 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 provided features is changed in the context of the associated IBmModel.
      Parameters:
      features - the features to monitor.
    • getBmModel

      protected final IBmModel getBmModel()
      Returns the BM model.
      Returns:
      the BM model, never null.