Class BmCachingTreeFilter

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Disposes this tree item filter.
      protected IBmModel getBmModel()
      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 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 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.
    • Constructor Detail

      • 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 Detail

      • 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.