Add to a value. If the key does not exist, an new pair is initialized with the value supplied. @webref intdict:method @webBrief Add to a value
(String key, int amount)
| 447 | * @webBrief Add to a value |
| 448 | */ |
| 449 | public void add(String key, int amount) { |
| 450 | int index = index(key); |
| 451 | if (index == -1) { |
| 452 | create(key, amount); |
| 453 | } else { |
| 454 | values[index] += amount; |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | |
| 459 | /** |