/** * Returns the compact stringified version of the group in the format * {(actual-name)(display-name)(value)[][][]} where [] are compact strings for the * counters within. */ public String makeEscapedCompactString() { StringBuffer buf = new StringBuffer(); buf.append(GROUP_OPEN); // group start // Add the group name buf.append(UNIT_OPEN); buf.append(escape(getName())); buf.append(UNIT_CLOSE); // Add the display name buf.append(UNIT_OPEN); buf.append(escape(getDisplayName())); buf.append(UNIT_CLOSE); // write the value for(Counter counter: subcounters.values()) { buf.append(counter.makeEscapedCompactString()); } buf.append(GROUP_CLOSE); // group end return buf.toString(); }
/** * Returns the compact stringified version of the group in the format * {(actual-name)(display-name)(value)[][][]} where [] are compact strings for the * counters within. */ public String makeEscapedCompactString() { StringBuffer buf = new StringBuffer(); buf.append(GROUP_OPEN); // group start // Add the group name buf.append(UNIT_OPEN); buf.append(escape(getName())); buf.append(UNIT_CLOSE); // Add the display name buf.append(UNIT_OPEN); buf.append(escape(getDisplayName())); buf.append(UNIT_CLOSE); // write the value for(Counter counter: subcounters.values()) { buf.append(counter.makeEscapedCompactString()); } buf.append(GROUP_CLOSE); // group end return buf.toString(); }
int length = escapedName.length() + escapedDispName.length(); for (Counter counter : subcounters.values()) { String escapedStr = counter.makeEscapedCompactString(); subcountersArray[i++] = escapedStr; length += escapedStr.length(); builder.append(counter.makeEscapedCompactString());