aboutsummaryrefslogtreecommitdiff
path: root/Mammoth/Couscous/java/util/HashMap.cs
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-03-30 23:09:24 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-01 16:15:41 +0100
commit5b174110627839214c1413255e1c6715ff7d0aab (patch)
tree3f2a97c071f82c0e44d9846a931f813474250764 /Mammoth/Couscous/java/util/HashMap.cs
parent99ed1b53f084322c06975a2183d812db5f257d34 (diff)
Update java-mammoth to 1.3.1
Diffstat (limited to 'Mammoth/Couscous/java/util/HashMap.cs')
-rw-r--r--Mammoth/Couscous/java/util/HashMap.cs27
1 files changed, 19 insertions, 8 deletions
diff --git a/Mammoth/Couscous/java/util/HashMap.cs b/Mammoth/Couscous/java/util/HashMap.cs
index 10070fc..13383a8 100644
--- a/Mammoth/Couscous/java/util/HashMap.cs
+++ b/Mammoth/Couscous/java/util/HashMap.cs
@@ -4,29 +4,36 @@ using Mammoth.Couscous.org.zwobble.mammoth.@internal.util;
using Mammoth.Couscous.java.lang;
namespace Mammoth.Couscous.java.util {
- internal class HashMap<TKey, TValue> : Map<TKey, TValue> {
- private readonly IDictionary<TKey, TValue> _dictionary;
+ internal class HashMap<TKey, TValue> : AbstractMap<TKey, TValue> {
+ private readonly Dictionary<TKey, TValue> _dictionary;
internal HashMap() : this(new Dictionary<TKey, TValue>()) {
}
- internal HashMap(IDictionary<TKey, TValue> dictionary) {
+ internal HashMap(Dictionary<TKey, TValue> dictionary) {
_dictionary = dictionary;
}
- public void put(TKey key, TValue value) {
+ internal HashMap(Map<TKey, TValue> map) : this(new Dictionary<TKey, TValue>(map.AsDictionary())) {
+ }
+
+ public override void put(TKey key, TValue value) {
_dictionary[key] = value;
}
- public bool containsKey(TKey key) {
+ public override bool containsKey(TKey key) {
return _dictionary.ContainsKey(key);
}
- public Set<Map__Entry<TKey, TValue>> entrySet() {
+ public override Set<Map__Entry<TKey, TValue>> entrySet() {
return new EntrySet(_dictionary);
}
- public Optional<TValue> _lookup(TKey key) {
+ public override Collection<TValue> values() {
+ return ToJava.CollectionToCollection(_dictionary.Values);
+ }
+
+ public override Optional<TValue> _lookup(TKey key) {
if (_dictionary.ContainsKey(key)) {
return new Some<TValue>(_dictionary[key]);
} else {
@@ -34,7 +41,11 @@ namespace Mammoth.Couscous.java.util {
}
}
- public IDictionary<TKey, TValue> AsDictionary() {
+ public override IDictionary<TKey, TValue> AsDictionary() {
+ return _dictionary;
+ }
+
+ public override System.Collections.IDictionary AsUntypedDictionary() {
return _dictionary;
}