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;
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();
+ }
+
}