diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java index f23c8f981..5167cf35c 100644 --- a/core/src/processing/data/FloatDict.java +++ b/core/src/processing/data/FloatDict.java @@ -246,6 +246,11 @@ public class FloatDict { } + public boolean hasKey(String key) { + return index(key) != -1; + } + + // /** Increase the value of a specific key by 1. */ // public void inc(String key) { // inc(key, 1); diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java index 18c95aea2..dfa079980 100644 --- a/core/src/processing/data/IntDict.java +++ b/core/src/processing/data/IntDict.java @@ -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); diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index c72d370e0..a07bbb3fb 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -215,6 +215,11 @@ public class StringDict { } + public boolean hasKey(String key) { + return index(key) != -1; + } + + protected void create(String key, String value) { if (count == keys.length) { keys = PApplet.expand(keys);