add setIndex() method

This commit is contained in:
Ben Fry
2017-10-10 20:34:40 -04:00
parent 28ee67ff22
commit 2327009d88
3 changed files with 29 additions and 0 deletions

View File

@@ -348,6 +348,16 @@ public class IntDict {
}
}
public void setIndex(int index, String key, int value) {
if (index < 0 || index >= count) {
throw new ArrayIndexOutOfBoundsException(index);
}
keys[index] = key;
values[index] = value;
}
/**
* @webref intdict:method
* @brief Check if a key is a part of the data structure