X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fruntime%2Fprofiling%2FBranchPoint.java;h=6b6d12fe49f7d658706a7fdc88d5d3ff6a59b1a5;hp=77b8f80ef7f99abf25fd83062c17331b9d60b26c;hb=ffdf837;hpb=d1a82fe1414c77b97bec886d6a3ae3c5d926c334 diff --git a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/profiling/BranchPoint.java b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/profiling/BranchPoint.java index 77b8f80ef..6b6d12fe4 100644 --- a/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/profiling/BranchPoint.java +++ b/bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/profiling/BranchPoint.java @@ -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(); + } + }