main
1using System.Collections;
2
3namespace gorilla.commons.utility
4{
5 public class Context : IContext
6 {
7 readonly IDictionary items;
8
9 public Context(IDictionary items)
10 {
11 this.items = items;
12 }
13
14 public bool contains<T>(IKey<T> key)
15 {
16 return key.is_found_in(items);
17 }
18
19 public void add<T>(IKey<T> key, T value)
20 {
21 key.add_value_to(items, value);
22 }
23
24 public T value_for<T>(IKey<T> key)
25 {
26 return key.parse_from(items);
27 }
28
29 public void remove<T>(IKey<T> key)
30 {
31 key.remove_from(items);
32 }
33 }
34}