ptolemy.actor.gt
Interface MatchCallback

All Known Implementing Classes:
IterativeParameter, MatchResultRecorder, TransformationMode

public interface MatchCallback

An interface of callback routines to be invoked during the matching.

Since:
Ptolemy II 6.1
Version:
$Id: MatchCallback.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Thomas Huining Feng
See Also:
GraphMatcher.setMatchCallback(MatchCallback)
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Method Summary
 boolean foundMatch(GraphMatcher matcher)
          A routine to be called when a match is found in the graph matching.
 

Method Detail

foundMatch

boolean foundMatch(GraphMatcher matcher)
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.

Parameters:
matcher - The graph matcher.
Returns:
Whether the matching should terminate right away.