aboutsummaryrefslogtreecommitdiff
path: root/runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:07:13 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:07:13 +0000
commitd8dbfae20884fab8728b4150ff20d2ef7339394e (patch)
tree175590417700c14fe86aac39848f249e79c1c6ba /runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs
parent9649b94da6e3480e98ba5f201c852c123117ddf8 (diff)
parent16467b971bd3e2009fad32dd79016f2c7e421deb (diff)
downloadantlr-android14-mainline-sdkext-release.tar.gz
Change-Id: Id3561900d3b3350ba0dfce4ae2d3111c89e4a34f
Diffstat (limited to 'runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs')
-rw-r--r--runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs86
1 files changed, 0 insertions, 86 deletions
diff --git a/runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs b/runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs
deleted file mode 100644
index 16cfc26..0000000
--- a/runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-namespace Antlr.Runtime.Debug.Misc
-{
- using System.Collections.Generic;
-
- public class DoubleKeyMap<TKey1, TKey2, TValue>
- {
- internal IDictionary<TKey1, IDictionary<TKey2, TValue>> data = new Dictionary<TKey1, IDictionary<TKey2, TValue>>();
-
- public virtual TValue Put(TKey1 k1, TKey2 k2, TValue v)
- {
- IDictionary<TKey2, TValue> data2;
- data.TryGetValue(k1, out data2);
- TValue prev = default(TValue);
- if (data2 == null)
- {
- data2 = new Dictionary<TKey2, TValue>();
- data[k1]=data2;
- }
- else
- {
- data2.TryGetValue(k2, out prev);
- }
- data2[k2]= v;
- return prev;
- }
-
- public virtual TValue Get(TKey1 k1, TKey2 k2)
- {
- IDictionary<TKey2, TValue> data2;
- data.TryGetValue(k1, out data2);
- if (data2 == null)
- return default(TValue);
-
- TValue value;
- data2.TryGetValue(k2, out value);
- return value;
- }
-
- public virtual IDictionary<TKey2, TValue> Get(TKey1 k1)
- {
- IDictionary<TKey2, TValue> value;
- data.TryGetValue(k1, out value);
- return value;
- }
-
- /** Get all values associated with primary key */
- public virtual ICollection<TValue> Values(TKey1 k1)
- {
- IDictionary<TKey2, TValue> data2;
- data.TryGetValue(k1, out data2);
- if (data2 == null)
- return null;
-
- return data2.Values;
- }
-
- /** get all primary keys */
- public virtual ICollection<TKey1> KeySet()
- {
- return data.Keys;
- }
-
- /** get all secondary keys associated with a primary key */
- public virtual ICollection<TKey2> KeySet(TKey1 k1)
- {
- IDictionary<TKey2, TValue> data2;
- data.TryGetValue(k1, out data2);
- if (data2 == null)
- return null;
-
- return data2.Keys;
- }
-
- public virtual ICollection<TValue> Values()
- {
- Dictionary<TValue, bool> s = new Dictionary<TValue, bool>();
- foreach (IDictionary<TKey2, TValue> k2 in data.Values)
- {
- foreach (TValue v in k2.Values)
- s[v] = true;
- }
-
- return s.Keys;
- }
- }
-}