[libgee] Add read_only to Map.Entry



commit 40b8cb17db34e2b6e88b1d7d0614e9ab51e04496
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Mon Aug 20 00:20:05 2012 -0700

    Add read_only to Map.Entry

 gee/hashmap.vala |    2 ++
 gee/map.vala     |    5 +++++
 gee/treemap.vala |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gee/hashmap.vala b/gee/hashmap.vala
index 81223f1..a538927 100644
--- a/gee/hashmap.vala
+++ b/gee/hashmap.vala
@@ -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> {
diff --git a/gee/map.vala b/gee/map.vala
index 3770e9e..33b99a3 100644
--- a/gee/map.vala
+++ b/gee/map.vala
@@ -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; }
 	}
 
 	/**
diff --git a/gee/treemap.vala b/gee/treemap.vala
index c28679e..7d03111 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -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) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]