ptolemy.vergil.gt
Class MatchResultRecorder

java.lang.Object
  extended by ptolemy.vergil.gt.MatchResultRecorder
All Implemented Interfaces:
MatchCallback

public class MatchResultRecorder
extends java.lang.Object
implements MatchCallback

Since:
Ptolemy II 8.0
Version:
$Id: MatchResultRecorder.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Field Summary
private  java.util.List<MatchResult> _results
           
 
Constructor Summary
MatchResultRecorder()
           
 
Method Summary
 boolean foundMatch(GraphMatcher matcher)
          A routine to be called when a match is found in the graph matching.
 java.util.List<MatchResult> getResults()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_results

private java.util.List<MatchResult> _results
Constructor Detail

MatchResultRecorder

public MatchResultRecorder()
Method Detail

foundMatch

public boolean foundMatch(GraphMatcher matcher)
Description copied from interface: MatchCallback
A routine to be called when a match is found in the graph matching. The graph matcher is passed in as the parameter, and the current match can be obtained by calling GraphMatcher.getMatchResult(). This match result should not be kept, however, because it may be changed by future matching operations. To keep a copy of this result, invoke MatchResult.clone() and keep the cloned copy. The return value indicates whether the match is the one looked for. If it is true, the matching will terminate after this routine returns, and no more match result will be reported.

Specified by:
foundMatch in interface MatchCallback
Parameters:
matcher - The graph matcher.
Returns:
Whether the matching should terminate right away.

getResults

public java.util.List<MatchResult> getResults()