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.boolean
isCompatibleWith
(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 String
boolean
Sets 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, wait
Methods 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:IPatternMatch
Returns the value of the parameter at the given position, or null if position is invalid.- Specified by:
get
in interfaceIPatternMatch
-
set
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
-
isCompatibleWith
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
- Parameters:
other
-- Returns:
- true, if this is compatible with other, or other is null
-
patternName
Description copied from interface:IPatternMatch
Identifies the name of the pattern for which this is a match.- Specified by:
patternName
in interfaceIPatternMatch
-
parameterNames
Description copied from interface:IPatternMatch
Returns the list of symbolic parameter names.- Specified by:
parameterNames
in interfaceIPatternMatch
-