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.Object
get(int position)
Returns the value of the parameter at the given position, or null if position is invalid.boolean
isCompatibleWith(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.String
patternName()
Identifies the name of the pattern for which this is a match.static java.lang.String
prettyPrintFeature(java.lang.Object o, java.lang.String featureName)
static java.lang.String
prettyPrintValue(java.lang.Object o)
boolean
set(int position, java.lang.Object newValue)
Sets the parameter at the given position to the given value.java.lang.String
toString()
-
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:IPatternMatch
Returns the value of the parameter at the given position, or null if position is invalid.- Specified by:
get
in interfaceIPatternMatch
-
set
public boolean set(int position, java.lang.Object newValue)
Description copied from interface:IPatternMatch
Sets the parameter at the given position to the given value.Works only if match is mutable. See
IPatternMatch.isMutable()
.- Specified by:
set
in interfaceIPatternMatch
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isCompatibleWith
public boolean isCompatibleWith(IPatternMatch other)
Description copied from interface:IPatternMatch
Checks 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:
isCompatibleWith
in interfaceIPatternMatch
- Returns:
- true, if this is compatible with other, or other is null
-
patternName
public java.lang.String patternName()
Description copied from interface:IPatternMatch
Identifies the name of the pattern for which this is a match.- Specified by:
patternName
in interfaceIPatternMatch
-
parameterNames
public java.util.List<java.lang.String> parameterNames()
Description copied from interface:IPatternMatch
Returns the list of symbolic parameter names.- Specified by:
parameterNames
in interfaceIPatternMatch
-
-