]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/utils/MethodSizeCounter.java
(refs #7250) Merging master, minor CHR bugfixes
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / utils / MethodSizeCounter.java
1 package org.simantics.scl.compiler.internal.codegen.utils;
2
3 public class MethodSizeCounter {
4     public String maxMethodName;
5     public int methodSizeLower;
6     public int methodSizeUpper;
7     
8     public void update(String methodName, int lower, int upper) {
9         if(upper > methodSizeUpper) {
10             maxMethodName = methodName;
11             methodSizeLower = lower;
12             methodSizeUpper = upper;
13         }
14     }
15     
16     @Override
17     public String toString() {
18         if(methodSizeLower == methodSizeUpper)
19             return maxMethodName + " " + methodSizeLower;
20         else
21             return maxMethodName + " [" + methodSizeLower + "," + methodSizeUpper + "]";
22     }
23 }