Move key_type/value_type implementation to multimap interface
authorMaciej Piechotka <uzytkownik2@gmail.com>
Mon, 20 Aug 2012 07:00:46 +0000 (00:00 -0700)
committerMaciej Piechotka <uzytkownik2@gmail.com>
Mon, 20 Aug 2012 07:00:46 +0000 (00:00 -0700)
gee/abstractmultimap.vala
gee/multimap.vala

index 2c71ed5..3f0d205 100644 (file)
@@ -135,10 +135,6 @@ public abstract class Gee.AbstractMultiMap<K,V> : Object, MultiMap<K,V> {
 
        protected abstract EqualDataFunc<V> get_value_equal_func ();
 
-       public Type key_type { get { return typeof(K); } }
-
-       public Type value_type { get { return typeof(V); } }
-
        private class MappingIterator<K, V> : Object {
                protected Gee.MapIterator<K, Collection<V>> outer;
                protected Iterator<V>? inner = null;
index 49a17fc..5698b33 100644 (file)
@@ -23,6 +23,7 @@
 /**
  * A map with multiple values per key.
  */
+[GenericAccessors]
 public interface Gee.MultiMap<K,V> : Object {
        /**
         * The number of key/value pairs in this map.
@@ -117,10 +118,10 @@ public interface Gee.MultiMap<K,V> : Object {
        /**
         * The type of the keys in this multimap.
         */
-       public abstract Type key_type { get; }
+       public virtual Type key_type { get { return typeof (K); } }
 
        /**
         * The type of the values in this multimap.
         */
-       public abstract Type value_type { get; }
+       public virtual Type value_type { get { return typeof (V); } }
 }