add hasKey() methods

This commit is contained in:
Ben Fry
2013-04-28 15:13:51 -04:00
parent 2daa6269b2
commit 3ab855e69a
3 changed files with 15 additions and 0 deletions

View File

@@ -235,6 +235,11 @@ public class IntDict {
}
public boolean hasKey(String key) {
return index(key) != -1;
}
/** Increase the value of a specific key by 1. */
public void increment(String key) {
add(key, 1);