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 Description MappingTraceCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 canonicalPTraceable
s in the original query which are the sources of the given derivativePTraceable
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 thePTraceable
s in the rewritten query which are the destinations of the given sourcePTraceable
according to the transformation.boolean
isRemoved(PTraceable traceable)
Returns whether the given traceable element has been removed by every rewriter for a reason.
-
-
-
Method Detail
-
getCanonicalTraceables
public java.util.stream.Stream<PTraceable> getCanonicalTraceables(PTraceable derivative)
Description copied from interface:IPTraceableTraceProvider
Find and return the canonicalPTraceable
s in the original query which are the sources of the given derivativePTraceable
according to the transformation.- Specified by:
getCanonicalTraceables
in interfaceIPTraceableTraceProvider
- Parameters:
derivative
- aPTraceable
which is contained by thePQuery
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 thePTraceable
s in the rewritten query which are the destinations of the given sourcePTraceable
according to the transformation.- Specified by:
getRewrittenTraceables
in interfaceIPTraceableTraceProvider
- Parameters:
source
- aPTraceable
which is contained by aPQuery
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 interfaceIRewriterTraceCollector
-
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 interfaceIRewriterTraceCollector
-
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 interfaceIPTraceableTraceProvider
-
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 interfaceIPTraceableTraceProvider
- Returns:
- the reasons of removal during rewriting
- Since:
- 2.0
-
-