aboutsummaryrefslogtreecommitdiff
path: root/runtime/CSharp3/Sources/Antlr3.Runtime.Debug/Misc/DoubleKeyMap`3.cs
diff options
context:
space:
mode:
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;
- }
- }
-}