List of utility methods to do List Replace
void | replaceAndAdd(List par3List, String translateToLocal) replace And Add translateToLocal = translateToLocal.replace('&', ((char) 167)); for (String str : translateToLocal.split("@NL@")) par3List.add(str); |
String | replaceAtSymbol(String s, List replace At Symbol for (String param : params) { String paramTemp = VELOCITY_VARIABLE_PREFIX + param + VELOCITY_VARIABLE_SUFFIX; s = s.replaceFirst("@([\\w]*)", paramTemp); return s; |
List | replaceColons(List replace Colons List<String> colonFreeSentences = new ArrayList<String>(); for (String unstructuredSentence : unstructuredSentences) { String colonFreeSentence = unstructuredSentence.replaceAll("\\.", SPACE); colonFreeSentences.add(colonFreeSentence); return colonFreeSentences; |
String | replaceFields(Map replace Fields Object[] keys = mapFields.keySet().toArray(); Comparator comparator = new Comparator() { public int compare(Object o1, Object o2) { int length1 = ((String) o1).length(); int length2 = ((String) o2).length(); if (length1 > length2) return -1; if (length1 == length2) { ... |
String | replaceIgnoreList(String text) Replaces the ignored characters. text = " " + text; for (String exception : exceptionToReplaceWith.keySet()) { text = text.replaceAll(exception, exceptionToReplaceWith.get(exception)); text = text.replaceAll(ignoredCharRegex, replacementForIgnoredChar); return text; |
List | replaceInLines(List replace In Lines List<String> list = new ArrayList<String>(); if (fromIndex == -1) fromIndex = 0; if (toIndex == -1) toIndex = lines.size(); for (int i = 0; i < lines.size(); i++) { String line = lines.get(i); String outputLine = line; ... |
boolean | replaceInList(T a, T b, List replace In List final int max = list.size(); for (int i = 0; i < max; i++) { if (list.get(i) == a) { list.set(i, b); return true; return false; ... |
String | replaceList(String v, String[] patterns, String[] values) Replaces all occurrences of "patterns" in "v" with "values" for (int i = 0; i < patterns.length; i++) { v = replace(v, patterns[i], values[i]); return v; |
void | replaceNpcId(final List Method to Replace the NPC ID on the Current Line w/ a New One final String npcIdLine = npcListSqlLines.get(lineIndex); final int endIndex = npcIdLine.indexOf(","); final String insertStringFragment = npcIdLine.substring(0, NPC_LIST_INSERT_START.length()); final String postIdFragment = npcIdLine.substring(endIndex, npcIdLine.length()); String newNpcIdLine = insertStringFragment + newNpcId + postIdFragment; if (markAsGuess) { newNpcIdLine = "FIXME: " + newNpcIdLine; npcListSqlLines.set(lineIndex, newNpcIdLine); |
List | replaceOrAdd(List replace Or Add if (list == null || object == null) return list; int i = list.indexOf(object); if (i != -1) { list.remove(object); list.add(i, object); } else { list.add(object); ... |