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: MatchResult.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Thomas Huining Feng
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Methods inherited from class java.util.HashMap |
containsKey, entrySet, get, isEmpty, keySet, putAll, size |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
_parameterValues
private SequentialTwoWayHashMap<ValueIterator,Token> _parameterValues
- The assignment of values to the parameters.
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.
clone
public java.lang.Object clone()
- Clone this match result and return the clone.
- Overrides:
clone
in class SequentialTwoWayHashMap<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 of
NamedObj
.
- Overrides:
toString
in class java.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 of
NamedObj
are ignored. Otherwise, those matches are also included in the string.
- Parameters:
allMatches
- Whether the matches between objects that are not
instances of NamedObj
are included.
- Returns:
- The string.