List of utility methods to do Comma Separated List
int | extractCommaItems(List extract Comma Items int count, offset; String tag; count = 0; while (!tags.isEmpty()) { offset = tags.indexOf(","); if (offset >= 0) { tag = tags.substring(0, offset).trim(); tags = tags.substring(tag.length() + 1).trim(); ... |
void | extractCommandsFromLine(final String line, final String delimiter, final StringBuilder bufferedCommand, final List Extracts SQL commands from string. final String[] lineParts = line.split(delimiter); for (int i = 0; i < lineParts.length; i++) { if (i == 0) { extractedCommands.add(bufferedCommand.toString() + " " + lineParts[i]); bufferedCommand.setLength(0); bufferedCommand.trimToSize(); } else { if (i == (lineParts.length - 1) && !line.endsWith(delimiter)) { ... |
String | formatCommand(List Formats arguments StringBuilder builder = new StringBuilder(); boolean redact = false; for (String string : arguments) { final boolean quote = string.contains(" "); if (quote) { builder.append("\""); builder.append(redact ? "{redacted}" : string); ... |
String | getAsCommaDelimitedString(List> coll) get As Comma Delimited String StringBuffer strBuffer = new StringBuffer(); for (Iterator<?> iter = coll.iterator(); iter.hasNext();) { Object obj = iter.next(); if (obj != null) { strBuffer.append(obj.toString()); strBuffer.append(","); return strBuffer.toString(); |
String | getCommaList(List Gets comma-separated list from a Vector of String s.
StringBuffer SB = new StringBuffer(); int size = V.size(); for (int i = 0; i < size; i++) { if (SB.length() > 0) SB.append(','); SB.append(V.get(i)); return SB.toString(); ... |
String | getCommandLine(List command) get Command Line if (command == null || command.isEmpty()) { return ""; String result = (String) command.get(0); for (int i = 1; i < command.size(); i++) { result += " " + command.get(i); return result; ... |
int | getCommandLineOptionInt(List get Command Line Option Int String s = getCommandLineOption(args, param, null); if (s == null) return defaultValue; return Integer.parseInt(s); |
String | getCommandStr(List get Command Str String s = ""; for (String _command : commandList) { s += _command + " "; return s; |
String | getCommaSeparatedList(Collection Utility method for creating display values StringBuilder values = new StringBuilder(); if (stringValues.size() == 0) { return values.toString(); Iterator<String> i = stringValues.iterator(); values.append((String) i.next()); while (i.hasNext()) { values.append(", "); ... |
String | getCommaSeparatedList(List list) Returns a string containing every element of the given list, with each element separated by a comma. StringBuilder buffer = new StringBuilder(); String separator = ""; for (Object e : list) { buffer.append(separator).append(e); separator = ","; return buffer.toString(); |