mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
add setIndex() method
This commit is contained in:
@@ -363,11 +363,21 @@ public class StringDict {
|
||||
}
|
||||
|
||||
|
||||
public void setIndex(int index, String key, String value) {
|
||||
if (index < 0 || index >= count) {
|
||||
throw new ArrayIndexOutOfBoundsException(index);
|
||||
}
|
||||
keys[index] = key;
|
||||
values[index] = value;
|
||||
}
|
||||
|
||||
|
||||
public int index(String what) {
|
||||
Integer found = indices.get(what);
|
||||
return (found == null) ? -1 : found.intValue();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref stringdict:method
|
||||
* @brief Check if a key is a part of the data structure
|
||||
|
||||
Reference in New Issue
Block a user