Package ptolemy.actor.gt.data
Class MatchResult
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- ptolemy.actor.gt.data.TwoWayHashMap<K,V>
-
- ptolemy.actor.gt.data.SequentialTwoWayHashMap<java.lang.Object,java.lang.Object>
-
- ptolemy.actor.gt.data.MatchResult
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
public class MatchResult extends SequentialTwoWayHashMap<java.lang.Object,java.lang.Object>
A two-way hash map data structure to store matches found in a pattern matching.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- See Also:
- Serialized Form
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Constructor Summary
Constructors Constructor Description MatchResult()
Construct an empty match result.MatchResult(SequentialTwoWayHashMap<ValueIterator,Token> parameterValues)
Construct an empty match result and tag it to be obtained by a specific assignment to the parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Clone this match result and return the clone.SequentialTwoWayHashMap<ValueIterator,Token>
getParameterValues()
Get the parameter assignment.java.lang.String
toString()
Generate a string describing this match result, ignoring the matches between objects that are not instances ofNamedObj
.java.lang.String
toString(boolean allMatches)
Generate a string describing this match result.-
Methods inherited from class ptolemy.actor.gt.data.SequentialTwoWayHashMap
clear, keys, put, remove, removeLast, retain
-
Methods inherited from class ptolemy.actor.gt.data.TwoWayHashMap
containsValue, getKey, values
-
Methods inherited from class java.util.HashMap
compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
-
-
-
-
Constructor Detail
-
MatchResult
public MatchResult()
Construct an empty match result.
-
MatchResult
public MatchResult(SequentialTwoWayHashMap<ValueIterator,Token> parameterValues)
Construct an empty match result and tag it to be obtained by a specific assignment to the parameters.- Parameters:
parameterValues
- The two-way hash map specifying the assignment to the parameters. In this case, values may be the same for some keys because the reverse hash map is never used.
-
-
Method Detail
-
clone
public java.lang.Object clone()
Clone this match result and return the clone.- Overrides:
clone
in classSequentialTwoWayHashMap<java.lang.Object,java.lang.Object>
- Returns:
- The clone.
-
getParameterValues
public SequentialTwoWayHashMap<ValueIterator,Token> getParameterValues()
Get the parameter assignment.- Returns:
- The two-way hash map for the assignment.
-
toString
public java.lang.String toString()
Generate a string describing this match result, ignoring the matches between objects that are not instances ofNamedObj
.- Overrides:
toString
in classjava.util.AbstractMap<java.lang.Object,java.lang.Object>
- Returns:
- The string.
-
toString
public java.lang.String toString(boolean allMatches)
Generate a string describing this match result. If allMatches is false, the matches between objects that are not instances ofNamedObj
are ignored. Otherwise, those matches are also included in the string.- Parameters:
allMatches
- Whether the matches between objects that are not instances ofNamedObj
are included.- Returns:
- The string.
-
-