/** * Represent the counter in a textual format that can be converted back to * its object form * @return the string in the following format * {(groupname)(group-displayname)[(countername)(displayname)(value)][][]}{}{} */ public synchronized String makeEscapedCompactString() { StringBuffer buffer = new StringBuffer(); for(Group group: this){ buffer.append(group.makeEscapedCompactString()); } return buffer.toString(); }
/** * Represent the counter in a textual format that can be converted back to * its object form * @return the string in the following format * {(groupname)(group-displayname)[(countername)(displayname)(value)][][]}{}{} */ public synchronized String makeEscapedCompactString() { StringBuffer buffer = new StringBuffer(); for(Group group: this){ buffer.append(group.makeEscapedCompactString()); } return buffer.toString(); }
/** * Represent the counter in a textual format that can be converted back to * its object form * @return the string in the following format * {(groupname)(group-displayname)[(countername)(displayname)(value)][][]}{}{} */ public synchronized String makeEscapedCompactString() { String[] groupsArray = new String[counters.size()]; int i = 0; int length = 0; // First up, obtain the escaped string for each group so that we can // determine the buffer length apriori. for (Group group : this) { String escapedString = group.makeEscapedCompactString(); groupsArray[i++] = escapedString; length += escapedString.length(); } // Now construct the buffer StringBuilder builder = new StringBuilder(length); for (String group : groupsArray) { builder.append(group); } return builder.toString(); }