Class BasePatternMatch
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch
-
- All Implemented Interfaces:
java.lang.Cloneable,IPatternMatch
- Direct Known Subclasses:
GenericPatternMatch
public abstract class BasePatternMatch extends java.lang.Object implements IPatternMatch
Base implementation of IPatternMatch.
-
-
Constructor Summary
Constructors Constructor Description BasePatternMatch()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(int position)Returns the value of the parameter at the given position, or null if position is invalid.booleanisCompatibleWith(IPatternMatch other)Checks that this match is compatible with the given other match.protected static <T> java.util.List<T>makeImmutableList(T... elements)java.util.List<java.lang.String>parameterNames()Returns the list of symbolic parameter names.java.lang.StringpatternName()Identifies the name of the pattern for which this is a match.static java.lang.StringprettyPrintFeature(java.lang.Object o, java.lang.String featureName)static java.lang.StringprettyPrintValue(java.lang.Object o)booleanset(int position, java.lang.Object newValue)Sets the parameter at the given position to the given value.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.api.IPatternMatch
get, isMutable, prettyPrint, set, specification, toArray, toImmutable
-
-
-
-
Method Detail
-
makeImmutableList
@SafeVarargs protected static <T> java.util.List<T> makeImmutableList(T... elements)
-
prettyPrintValue
public static java.lang.String prettyPrintValue(java.lang.Object o)
-
prettyPrintFeature
public static java.lang.String prettyPrintFeature(java.lang.Object o, java.lang.String featureName)
-
get
public java.lang.Object get(int position)
Description copied from interface:IPatternMatchReturns the value of the parameter at the given position, or null if position is invalid.- Specified by:
getin interfaceIPatternMatch
-
set
public boolean set(int position, java.lang.Object newValue)Description copied from interface:IPatternMatchSets the parameter at the given position to the given value.Works only if match is mutable. See
IPatternMatch.isMutable().- Specified by:
setin interfaceIPatternMatch
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isCompatibleWith
public boolean isCompatibleWith(IPatternMatch other)
Description copied from interface:IPatternMatchChecks that this match is compatible with the given other match. This is used for filtering the match set of a matcher. Two non-null matches are compatible if and only if:- They share the same pattern.
- For each parameter, where they are set (non-null) in both matches, their values are equal.
- Specified by:
isCompatibleWithin interfaceIPatternMatch- Returns:
- true, if this is compatible with other, or other is null
-
patternName
public java.lang.String patternName()
Description copied from interface:IPatternMatchIdentifies the name of the pattern for which this is a match.- Specified by:
patternNamein interfaceIPatternMatch
-
parameterNames
public java.util.List<java.lang.String> parameterNames()
Description copied from interface:IPatternMatchReturns the list of symbolic parameter names.- Specified by:
parameterNamesin interfaceIPatternMatch
-
-