List of utility methods to do List Replace
void | replace(final List replace if (!isIndexOutOfBounds(list, index)) {
list.remove(index);
list.add(index, newElement);
|
String | replace(final String source, final List replace String result = source; for (int i = 0; i < search.size(); ++i) { if (i < repl.size()) { result = result.replace(search.get(i), repl.get(i)); } else { result = result.replace(search.get(i), repl.get(repl.size() - 1)); return result; |
Object | replace(List list, Object o, Object n) Replaces the element o with n. int index = list.indexOf(o); if (index != -1) { return list.set(index, n); return null; |
List extends T> | replace(List extends T> list, T element, List replace List<T> list2 = new ArrayList<T>(list.size() + replacements.size()); for (T node : list) if (node != element) list2.add(node); list2.addAll(replacements); return list2; |
List | replace(List replace ArrayList<String> result = new ArrayList<String>(list); for (int i = 0; i < list.size(); i++) { result.set(i, result.get(i).replace(target, replacement)); return result; |
T | replace(List Replace an item with another item for the list if (isEmpty(list)) return null; if (!list.contains(from)) return null; int index = list.indexOf(from); list.set(index, to); return to; |
String | replace(String s, List replace for (String r : replacementVars) { s = s.replaceFirst("\\{\\}", r); return s; |
String | replace(String sourceStr, List replace if (indexList.isEmpty()) { return sourceStr; StringBuffer bf = new StringBuffer(); int t = 0; int i = 0; for (int[] ii : indexList) { bf.append(sourceStr.substring(t, ii[0]).trim()).append(replaceStr); ... |
boolean | replaceAll(final List replace All return Collections.replaceAll(list, element0, element1);
|
boolean | replaceAllInList(T a, T b, List replace All In List final int max = list.size(); for (int i = 0; i < max; i++) { if (list.get(i) == a) { list.set(i, b); return false; |