]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/profiling/BranchPoint.java
Sync git svn branch with SVN repository r33249.
[simantics/platform.git] / bundles / org.simantics.scl.runtime / src / org / simantics / scl / runtime / profiling / BranchPoint.java
index 77b8f80ef7f99abf25fd83062c17331b9d60b26c..6b6d12fe49f7d658706a7fdc88d5d3ff6a59b1a5 100644 (file)
@@ -3,9 +3,9 @@ package org.simantics.scl.runtime.profiling;
 public class BranchPoint {
     public static final BranchPoint[] EMPTY_ARRAY = new BranchPoint[0];
     
-    public final long location;
-    public final int codeSize;
-    public final BranchPoint[] children;
+    private final long location;
+    private final int codeSize;
+    private final BranchPoint[] children;
     
     public int visitCounter;
 
@@ -17,7 +17,38 @@ public class BranchPoint {
     
     public void resetVisitCountersRecursively() {
         visitCounter = 0;
-        for(BranchPoint branchPoint : children)
+        for(BranchPoint branchPoint : getChildren())
             branchPoint.resetVisitCountersRecursively();
     }
+
+    public long getLocation() {
+        return location;
+    }
+
+    public int getCodeSize() {
+        return codeSize;
+    }
+    
+    public int getVisitCounter() {
+        return visitCounter;
+    }
+
+    public void incrementVisitCounter(int amount) {
+        visitCounter = visitCounter + amount;
+    }
+
+    public BranchPoint[] getChildren() {
+        return children;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("BP[visitCounter=").append(visitCounter).append(", codeSize=").append(codeSize).append(", location=").append(location);
+        if (children.length > 0)
+            sb.append(", children=").append(children.length);
+        sb.append("]");
+        return sb.toString();
+    }
+
 }