org.eclipse.viatra.query.runtime.matchers.psystem.rewriters

## Class MappingTraceCollector

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.psystem.rewriters.MappingTraceCollector

- All Implemented Interfaces:
    IPTraceableTraceProvider, IRewriterTraceCollector

      public class MappingTraceCollector
      extends java.lang.Object
      implements IRewriterTraceCollector

  Multimap-based implementation to contain and query traces
  Since:
    1.6

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MappingTraceCollector()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTrace(PTraceable original, PTraceable derivative)` Mark the given derivative to be originated from the given original constraint.
    `void` | `derivativeRemoved(PTraceable derivative, IDerivativeModificationReason reason)` Indicate that the given derivative is removed from the resulting query, thus its trace information should be removed also.
    `java.util.stream.Stream<PTraceable>` | `getCanonicalTraceables(PTraceable derivative)` Find and return the canonical `PTraceable`s in the original query which are the sources of the given derivative `PTraceable` according to the transformation.
    `java.util.stream.Stream<IDerivativeModificationReason>` | `getRemovalReasons(PTraceable traceable)` Returns the reasons for which the traceable element has been removed by the rewriters.
    `java.util.stream.Stream<PTraceable>` | `getRewrittenTraceables(PTraceable source)` Find and return the `PTraceable`s in the rewritten query which are the destinations of the given source `PTraceable` according to the transformation.
    `boolean` | `isRemoved(PTraceable traceable)` Returns whether the given traceable element has been removed by every rewriter for a reason.

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

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

- - ### Constructor Detail

    - #### MappingTraceCollector

          public MappingTraceCollector()

  - ### Method Detail

    - #### getCanonicalTraceables

          public java.util.stream.Stream<PTraceable> getCanonicalTraceables(PTraceable derivative)

      Description copied from interface: `IPTraceableTraceProvider`
      Find and return the canonical `PTraceable`s in the original query which are the sources of the given derivative `PTraceable` according to the transformation.
      Specified by:
        `getCanonicalTraceables` in interface `IPTraceableTraceProvider`
      Parameters:
        `derivative` - a `PTraceable` which is contained by the `PQuery` produced by the associated rewriter
      Since:
        2.0

    - #### getRewrittenTraceables

          public java.util.stream.Stream<PTraceable> getRewrittenTraceables(PTraceable source)

      Description copied from interface: `IPTraceableTraceProvider`
      Find and return the `PTraceable`s in the rewritten query which are the destinations of the given source `PTraceable` according to the transformation.
      Specified by:
        `getRewrittenTraceables` in interface `IPTraceableTraceProvider`
      Parameters:
        `source` - a `PTraceable` which is contained by a `PQuery` before rewriting
      Since:
        2.0

    - #### addTrace

          public void addTrace(PTraceable original,
                               PTraceable derivative)

      Description copied from interface: `IRewriterTraceCollector`
      Mark the given derivative to be originated from the given original constraint.
      Specified by:
        `addTrace` in interface `IRewriterTraceCollector`

    - #### derivativeRemoved

          public void derivativeRemoved(PTraceable derivative,
                                        IDerivativeModificationReason reason)

      Description copied from interface: `IRewriterTraceCollector`
      Indicate that the given derivative is removed from the resulting query, thus its trace information should be removed also.
      Specified by:
        `derivativeRemoved` in interface `IRewriterTraceCollector`

    - #### isRemoved

          public boolean isRemoved(PTraceable traceable)

      Description copied from interface: `IPTraceableTraceProvider`
      Returns whether the given traceable element has been removed by every rewriter for a reason.
      Specified by:
        `isRemoved` in interface `IPTraceableTraceProvider`

    - #### getRemovalReasons

          public java.util.stream.Stream<IDerivativeModificationReason> getRemovalReasons(PTraceable traceable)

      Description copied from interface: `IPTraceableTraceProvider`
      Returns the reasons for which the traceable element has been removed by the rewriters.
      Specified by:
        `getRemovalReasons` in interface `IPTraceableTraceProvider`
      Returns:
        the reasons of removal during rewriting
      Since:
        2.0