Add read_only to Map.Entry
authorMaciej Piechotka <uzytkownik2@gmail.com>
Mon, 20 Aug 2012 07:20:05 +0000 (00:20 -0700)
committerMaciej Piechotka <uzytkownik2@gmail.com>
Mon, 20 Aug 2012 07:20:05 +0000 (00:20 -0700)
gee/hashmap.vala
gee/map.vala
gee/treemap.vala

index 81223f1..a538927 100644 (file)
@@ -326,6 +326,8 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
                        get { return _node.value; }
                        set { _node.value = value; }
                }
+
+               public override bool read_only { get { return false; } }
        }
 
        private class KeySet<K,V> : AbstractSet<K> {
index 3770e9e..33b99a3 100644 (file)
@@ -69,6 +69,11 @@ public interface Gee.Map<K,V> : Object, Iterable<Map.Entry<K,V>> {
                 * The value of this entry.
                 */
                public abstract V value { get; set; }
+
+               /**
+                * ``true'' if the setting value is permitted.
+                */
+               public abstract bool read_only { get; }
        }
 
        /**
index c28679e..7d03111 100644 (file)
@@ -570,6 +570,8 @@ public class Gee.TreeMap<K,V> : Gee.AbstractBidirSortedMap<K,V> {
                        get { return _node.value; }
                        set { _node.value = value; }
                }
+
+               public override bool read_only { get { return false; } }
        }
 
        private inline unowned Node<K,V>? find_lower (K key) {