MCPcopy Index your code
hub / github.com/processing/processing / replaceValue

Method replaceValue

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

Source from the content-addressed store, hash-verified

249
250 // replace the first value that matches, return the index that was replaced
251 public int replaceValue(String value, String newValue) {
252 if (value == null) {
253 for (int i = 0; i < count; i++) {
254 if (data[i] == null) {
255 data[i] = newValue;
256 return i;
257 }
258 }
259 } else {
260 for (int i = 0; i < count; i++) {
261 if (value.equals(data[i])) {
262 data[i] = newValue;
263 return i;
264 }
265 }
266 }
267 return -1;
268 }
269
270
271 // replace all values that match, return the count of those replaced

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected