diff --git a/org.ntlab.traceAnalyzer/src/org/ntlab/trace/MethodExecutionJPDA.java b/org.ntlab.traceAnalyzer/src/org/ntlab/trace/MethodExecutionJPDA.java index f95a2ed..c06bb3f 100644 --- a/org.ntlab.traceAnalyzer/src/org/ntlab/trace/MethodExecutionJPDA.java +++ b/org.ntlab.traceAnalyzer/src/org/ntlab/trace/MethodExecutionJPDA.java @@ -42,4 +42,27 @@ public MethodExecutionJPDA getCallerMethodExecution() { return callerMethodExecution; } + + /** + * ���̃��\�b�h���s����т��̑S�Ăяo������Ăяo���؂̒��ŋt�����ɒT������(�������Avisitor �� true ��Ԃ��܂�) + * @param visitor �r�W�^�[ + * @return�@true -- �T���𒆒f����, false -- �Ō�܂ŒT������ + */ + public boolean traverseMethodExecutionsBackward(IMethodExecutionVisitorJPDA visitor) { + if (visitor.preVisitMethodExecution(this)) return true; + ArrayList calledMethodExecutions = getChildren(); + for (int i = calledMethodExecutions.size() - 1; i >= 0; i--) { + MethodExecutionJPDA child = calledMethodExecutions.get(i); + if (child.traverseMethodExecutionsBackward(visitor)) return true; + } + if (visitor.postVisitMethodExecution(this, null)) return true; + return false; + } + + public interface IMethodExecutionVisitorJPDA { + abstract public boolean preVisitThread(ThreadInstanceJPDA thread); + abstract public boolean postVisitThread(ThreadInstanceJPDA thread); + abstract public boolean preVisitMethodExecution(MethodExecutionJPDA methodExecution); + abstract public boolean postVisitMethodExecution(MethodExecutionJPDA methodExecution, ArrayList children); + } }