int end = endOf(location);
return formula.substring(0, begin) + annotationBegin + formula.substring(begin, end) + annotationEnd + formula.substring(end);
}
+
+ public static long sublocation(long location, int localBegin, int localEnd) {
+ int begin = beginOf(location);
+ int end = endOf(location);
+ if(localEnd > end-begin)
+ localEnd = begin-end;
+ return location(begin+localBegin, begin+localEnd);
+ }
+
+ public static String toString(long location) {
+ if(location == NO_LOCATION)
+ return "NO LOCATION";
+ else
+ return beginOf(location) + "-" + endOf(location);
+ }
}