001    package org.shiftone.jrat.provider.tree.ui.hierarchy.nodes;
002    
003    import org.shiftone.jrat.provider.tree.ui.summary.MethodSummary;
004    import org.shiftone.jrat.provider.tree.ui.summary.MethodSummaryModel;
005    
006    /**
007     * @author jeff@shiftone.org (Jeff Drost)
008     */
009    public class MethodSummaryHierarchyNode extends MethodHierarchyNode {
010    
011        private final MethodSummary methodSummary;
012    
013        public MethodSummaryHierarchyNode(MethodSummary methodSummary, MethodSummaryModel methodSummaryModel
014        ) {
015    
016            super(methodSummary.getMethodKey(), methodSummaryModel);
017    
018            this.methodSummary = methodSummary;
019        }
020    
021        public boolean isExecuted() {
022            return true;
023        }
024    
025        public int getExecutedMethods() {
026            return 1;
027        }
028    
029        public long getTotalDuration() {
030            return methodSummary.getTotalDuration();
031        }
032    
033        public Long getTotalMethodDuration() {
034            return methodSummary.getTotalMethodDuration();
035        }
036    
037        public MethodSummary getMethodSummary() {
038            return methodSummary;
039        }
040    
041        public long getTotalExits() {
042            return methodSummary.getTotalExists();
043        }
044    
045        public long getTotalErrors() {
046            return methodSummary.getTotalErrors();
047        }
048    }