org.eclipse.viatra.query.runtime.emf

## Class EMFBaseIndexWrapper

- java.lang.Object
- - org.eclipse.viatra.query.runtime.emf.EMFBaseIndexWrapper

- All Implemented Interfaces:
    IBaseIndex

      public class EMFBaseIndexWrapper
      extends java.lang.Object
      implements IBaseIndex

  Wraps the EMF base index into the IBaseIndex interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EMFBaseIndexWrapper(NavigationHelper navigationHelper)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBaseIndexChangeListener(ViatraBaseIndexChangeListener listener)` Adds a coarse-grained listener that will be invoked after the NavigationHelper index or the underlying model is changed.
    `boolean` | `addIndexingErrorListener(IIndexingErrorListener listener)` Adds a listener for internal errors in the index.
    `boolean` | `addInstanceObserver(IInstanceObserver observer, java.lang.Object observedObject)` Register a lightweight observer that is notified if any edge starting at the given Object changes.
    `<V> V` | `coalesceTraversals(java.util.concurrent.Callable<V> callable)` The given callback will be executed, and all model traversals and index registrations will be delayed until the execution is done.
    `NavigationHelper` | `getNavigationHelper()`
    `void` | `removeBaseIndexChangeListener(ViatraBaseIndexChangeListener listener)` Removes a registered listener.
    `boolean` | `removeIndexingErrorListener(IIndexingErrorListener listener)` Removes a listener for internal errors in the index
    `boolean` | `removeInstanceObserver(IInstanceObserver observer, java.lang.Object observedObject)` Unregisters a lightweight observer for the given Object.
    `void` | `resampleDerivedFeatures()` Updates the value of indexed derived features that are not well-behaving.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EMFBaseIndexWrapper

          public EMFBaseIndexWrapper(NavigationHelper navigationHelper)

      Parameters:
        `navigationHelper` -

  - ### Method Detail

    - #### getNavigationHelper

          public NavigationHelper getNavigationHelper()

      Returns:
        the underlying index object

    - #### resampleDerivedFeatures

          public void resampleDerivedFeatures()

      Description copied from interface: `IBaseIndex`
      Updates the value of indexed derived features that are not well-behaving.
      Specified by:
        `resampleDerivedFeatures` in interface `IBaseIndex`

    - #### coalesceTraversals

          public <V> V coalesceTraversals(java.util.concurrent.Callable<V> callable)
                                   throws java.lang.reflect.InvocationTargetException

      Description copied from interface: `IBaseIndex`
      The given callback will be executed, and all model traversals and index registrations will be delayed until the execution is done. If there are any outstanding feature, class or datatype registrations, a single coalesced model traversal will initialize the caches and deliver the notifications.
      Specified by:
        `coalesceTraversals` in interface `IBaseIndex`
      Throws:
        `java.lang.reflect.InvocationTargetException`

    - #### addIndexingErrorListener

          public boolean addIndexingErrorListener(IIndexingErrorListener listener)

      Description copied from interface: `IBaseIndex`
      Adds a listener for internal errors in the index. A listener can only be added once.
      Specified by:
        `addIndexingErrorListener` in interface `IBaseIndex`

    - #### removeIndexingErrorListener

          public boolean removeIndexingErrorListener(IIndexingErrorListener listener)

      Description copied from interface: `IBaseIndex`
      Removes a listener for internal errors in the index
      Specified by:
        `removeIndexingErrorListener` in interface `IBaseIndex`

    - #### addBaseIndexChangeListener

          public void addBaseIndexChangeListener(ViatraBaseIndexChangeListener listener)

      Description copied from interface: `IBaseIndex`
      Adds a coarse-grained listener that will be invoked after the NavigationHelper index or the underlying model is changed. Can be used e.g. to check model contents. Not intended for general use.

      See `IBaseIndex.removeBaseIndexChangeListener(ViatraBaseIndexChangeListener)`
      Specified by:
        `addBaseIndexChangeListener` in interface `IBaseIndex`

    - #### removeBaseIndexChangeListener

          public void removeBaseIndexChangeListener(ViatraBaseIndexChangeListener listener)

      Description copied from interface: `IBaseIndex`
      Removes a registered listener.

      See `IBaseIndex.addBaseIndexChangeListener(ViatraBaseIndexChangeListener)`
      Specified by:
        `removeBaseIndexChangeListener` in interface `IBaseIndex`

    - #### addInstanceObserver

          public boolean addInstanceObserver(IInstanceObserver observer,
                                             java.lang.Object observedObject)

      Description copied from interface: `IBaseIndex`
      Register a lightweight observer that is notified if any edge starting at the given Object changes.
      Specified by:
        `addInstanceObserver` in interface `IBaseIndex`
      Parameters:
        `observer` - the listener instance
        `observedObject` - the observed instance object
      Returns:
        false if no observer can be registered for the given instance (e.g. it is a primitive), or observer was already registered (call has no effect)

    - #### removeInstanceObserver

          public boolean removeInstanceObserver(IInstanceObserver observer,
                                                java.lang.Object observedObject)

      Description copied from interface: `IBaseIndex`
      Unregisters a lightweight observer for the given Object.
      Specified by:
        `removeInstanceObserver` in interface `IBaseIndex`
      Parameters:
        `observer` - the listener instance
        `observedObject` - the observed instance object
      Returns:
        false if no observer can be registered for the given instance (e.g. it is a primitive), or no observer was registered previously (call has no effect)