MCPcopy Index your code
hub / github.com/benfry/processing4 / replaceValues

Method replaceValues

core/src/processing/data/StringList.java:267–286  ·  view source on GitHub ↗
(String value, String newValue)

Source from the content-addressed store, hash-verified

265
266 // replace all values that match, return the count of those replaced
267 @SuppressWarnings("unused")
268 public int replaceValues(String value, String newValue) {
269 int changed = 0;
270 if (value == null) {
271 for (int i = 0; i < count; i++) {
272 if (data[i] == null) {
273 data[i] = newValue;
274 changed++;
275 }
276 }
277 } else {
278 for (int i = 0; i < count; i++) {
279 if (value.equals(data[i])) {
280 data[i] = newValue;
281 changed++;
282 }
283 }
284 }
285 return changed;
286 }
287
288
289 /**

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected