Class 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)
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • 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 of NamedObj.
      java.lang.String toString​(boolean allMatches)
      Generate a string describing this match result.
      • 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
      • 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
    • 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 class SequentialTwoWayHashMap<java.lang.Object,​java.lang.Object>
        Returns:
        The clone.
      • 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.