diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-16 11:22:33 -0500 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-11-16 11:22:33 -0500 |
| commit | f0e585d22c24eec3a723c6f0ea2a18252c570303 (patch) | |
| tree | ddeefae2872ee21e507131a8f08465cc81713c0f /BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java | |
| parent | d02e409ef8a389101970e70a105d30b7b1948ecf (diff) | |
Documentation update
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java index 8522058..e69495a 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java @@ -73,6 +73,17 @@ public interface IMap<KeyType, ValueType> { */ ValueType get(KeyType key); + /** + * Get a value from the map, and return a default value if the key + * doesn't exist + * + * @param key + * The key to attempt to retrieve + * @param defaultValue + * The value to return if the key doesn't exist + * @return The value associated with the key, or the default value if + * the key doesn't exist + */ default ValueType getOrDefault(KeyType key, ValueType defaultValue) { try { return get(key); |
