List of utility methods to do List Join
String | joinToString(List> list) join To String StringBuffer strBuf = new StringBuffer(); if (list != null) { for (Object item : list) { strBuf.append(item.toString()); return strBuf.toString(); |
String | JoinToString(List> list, String delimiter) Given a List and a delimiter, creates a delimited string of the objects in the List (using the toString() method of each object). return JoinToString(list, delimiter, false, null);
|
List | joinUnique(List extends T> list, T element) Joins a list with an element only if the element is not yet contained in the list. return list.contains(element) ? new ArrayList<T>(list) : join(list, element); |
String | joinWordList(List join Word List if (wordList.size() == 0) { return null; StringBuffer sb = new StringBuffer(); for (String e : wordList) { if (sb.length() > 0) { sb.append(delimiter); sb.append(e); return sb.toString(); |
String | listToStr(List list To Str if (isEmpty(list) || joinChar == null) { return ""; String listStr = ""; for (String item : list) { listStr = listStr + item + joinChar; listStr = listStr.substring(0, listStr.length() - joinChar.length()); ... |
String | listToText(List list To Text StringBuilder builder = new StringBuilder(); for (String line : list) { builder.append(line).append(join); if (builder.length() > 0) { builder.deleteCharAt(builder.length() - 1); return builder.toString(); ... |
List | orderJoinType(List order Join Type List<String> tempList = new ArrayList<String>(); if (jList.get(0).equals("subject") && jList.get(2).equals("object")) { tempList.add(jList.get(2)); tempList.add(jList.get(0)); tempList.add(jList.get(3)); tempList.add(jList.get(1)); return tempList; } else { ... |
List | reverseJoinType(List reverse Join Type List<String> tempList = new ArrayList<String>(); if (jList.get(2).equals("subject") && jList.get(3).equals("object")) { tempList.add(jList.get(3)); tempList.add(jList.get(2)); tempList.add(jList.get(1)); tempList.add(jList.get(0)); return tempList; } else if (jList.get(2).equals("predicate") && jList.get(3).equals("subject")) { ... |
String | sortAndJoin(List sort And Join Collections.sort(col);
return join(col, sep);
|
String | sortAndJoin(List sort And Join Collections.sort(list); StringBuilder builder = new StringBuilder(10 * list.size()); String sep = ""; for (String name : list) { builder.append(sep); builder.append(name); sep = " "; return builder.toString(); |