diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-09-28 13:44:04 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-09-28 13:44:04 -0400 |
| commit | f7a10e0e57d6f0ea83643c3d5763ff405af73337 (patch) | |
| tree | 7a56cbf7e5a8b6fa738d2cf469a86eea14d5d89a /BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java | |
| parent | ba0a3f53a88842a94ea6a1a6d45f61416b593e47 (diff) | |
Formatting pass
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 | 30 |
1 files changed, 15 insertions, 15 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 4fb7c2b..8522058 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java +++ b/BJC-Utils2/src/main/java/bjc/utils/funcdata/IMap.java @@ -17,6 +17,11 @@ import java.util.function.Function; */ public interface IMap<KeyType, ValueType> { /** + * Delete all the values in the map + */ + void clear(); + + /** * Check if this map contains the specified key * * @param key @@ -68,6 +73,16 @@ public interface IMap<KeyType, ValueType> { */ ValueType get(KeyType key); + default ValueType getOrDefault(KeyType key, ValueType defaultValue) { + try { + return get(key); + } catch (IllegalArgumentException iaex) { + // We don't care about this, because it indicates a key is + // missing + return defaultValue; + } + } + /** * Get the number of entries in this map * @@ -132,19 +147,4 @@ public interface IMap<KeyType, ValueType> { * @return A list of values in this map */ IList<ValueType> valueList(); - - /** - * Delete all the values in the map - */ - void clear(); - - default ValueType getOrDefault(KeyType key, ValueType defaultValue) { - try { - return get(key); - } catch (IllegalArgumentException iaex) { - // We don't care about this, because it indicates a key is - // missing - return defaultValue; - } - } }
\ No newline at end of file |
