Class BasePatternMatch
java.lang.Object
tools.refinery.interpreter.api.impl.BasePatternMatch
- All Implemented Interfaces:
Cloneable,IPatternMatch
- Direct Known Subclasses:
GenericPatternMatch
Base implementation of IPatternMatch.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(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> List<T> makeImmutableList(T... elements) Returns the list of symbolic parameter names.Identifies the name of the pattern for which this is a match.static StringbooleanSets the parameter at the given position to the given value.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface tools.refinery.interpreter.api.IPatternMatch
get, isMutable, prettyPrint, set, specification, toArray, toImmutable
-
Constructor Details
-
BasePatternMatch
public BasePatternMatch()
-
-
Method Details
-
makeImmutableList
-
prettyPrintValue
-
get
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
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
-
isCompatibleWith
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- Parameters:
other-- Returns:
- true, if this is compatible with other, or other is null
-
patternName
Description copied from interface:IPatternMatchIdentifies the name of the pattern for which this is a match.- Specified by:
patternNamein interfaceIPatternMatch
-
parameterNames
Description copied from interface:IPatternMatchReturns the list of symbolic parameter names.- Specified by:
parameterNamesin interfaceIPatternMatch
-