[libgee] Make [Deprecated] all Map methods previously marked as such in documentation



commit 20cf1d370edf1597931d345ef92a745cc54ba9bc
Author: Didier 'Ptitjes <ptitjes free fr>
Date:   Mon Aug 2 15:25:19 2010 +0200

    Make [Deprecated] all Map methods previously marked as such in documentation

 gee/abstractmap.vala      |    2 +-
 gee/abstractmultimap.vala |   14 +++++++-------
 gee/abstractmultiset.vala |   10 +++++-----
 gee/hashmap.vala          |    4 ++--
 gee/map.vala              |    4 ++++
 gee/treemap.vala          |    2 +-
 6 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/gee/abstractmap.vala b/gee/abstractmap.vala
index d3cd977..191a823 100644
--- a/gee/abstractmap.vala
+++ b/gee/abstractmap.vala
@@ -127,7 +127,7 @@ public abstract class Gee.AbstractMap<K,V> : Object, Iterable<Map.Entry<K,V>>, M
 	public virtual bool unset_all (Map<K,V> map) {
 		bool changed = false;
 		foreach (K key in map.keys) {
-			changed = changed | remove (key);
+			changed = changed | unset (key);
 		}
 		return changed;
 	}
diff --git a/gee/abstractmultimap.vala b/gee/abstractmultimap.vala
index d867607..5d0d230 100644
--- a/gee/abstractmultimap.vala
+++ b/gee/abstractmultimap.vala
@@ -72,11 +72,11 @@ public abstract class Gee.AbstractMultiMap<K,V> : Object, MultiMap<K,V> {
 	}
 
 	public bool contains (K key) {
-		return _storage_map.contains (key);
+		return _storage_map.has_key (key);
 	}
 
 	public new Collection<V> get (K key) {
-		if (_storage_map.contains (key)) {
+		if (_storage_map.has_key (key)) {
 			return _storage_map.get (key).read_only_view;
 		} else {
 			return _empty_value_set;
@@ -84,7 +84,7 @@ public abstract class Gee.AbstractMultiMap<K,V> : Object, MultiMap<K,V> {
 	}
 
 	public new void set (K key, V value) {
-		if (_storage_map.contains (key)) {
+		if (_storage_map.has_key (key)) {
 			if (_storage_map.get (key).add (value)) {
 				_nitems++;
 			}
@@ -97,13 +97,13 @@ public abstract class Gee.AbstractMultiMap<K,V> : Object, MultiMap<K,V> {
 	}
 
 	public bool remove (K key, V value) {
-		if (_storage_map.contains (key)) {
+		if (_storage_map.has_key (key)) {
 			var values = _storage_map.get (key);
 			if (values.contains (value)) {
 				values.remove (value);
 				_nitems--;
 				if (values.size == 0) {
-					_storage_map.remove (key);
+					_storage_map.unset (key);
 				}
 				return true;
 			}
@@ -112,9 +112,9 @@ public abstract class Gee.AbstractMultiMap<K,V> : Object, MultiMap<K,V> {
 	}
 
 	public bool remove_all (K key) {
-		if (_storage_map.contains (key)) {
+		if (_storage_map.has_key (key)) {
 			int size = _storage_map.get (key).size;
-			if (_storage_map.remove (key)) {
+			if (_storage_map.unset (key)) {
 				_nitems -= size;
 				return true;
 			}
diff --git a/gee/abstractmultiset.vala b/gee/abstractmultiset.vala
index 1b5d444..6d2a5e5 100644
--- a/gee/abstractmultiset.vala
+++ b/gee/abstractmultiset.vala
@@ -44,14 +44,14 @@ public abstract class Gee.AbstractMultiSet<G> : AbstractCollection<G>, MultiSet<
 
 	public int count (G item) {
 		int result = 0;
-		if (_storage_map.contains (item)) {
+		if (_storage_map.has_key (item)) {
 			result = _storage_map.get (item);
 		}
 		return result;
 	}
 
 	public override bool contains (G item) {
-		return _storage_map.contains (item);
+		return _storage_map.has_key (item);
 	}
 
 	public override Gee.Iterator<G> iterator () {
@@ -59,7 +59,7 @@ public abstract class Gee.AbstractMultiSet<G> : AbstractCollection<G>, MultiSet<
 	}
 
 	public override bool add (G item) {
-		if (_storage_map.contains (item)) {
+		if (_storage_map.has_key (item)) {
 			int current_count = _storage_map.get (item);
 			_storage_map.set (item, current_count + 1);
 		} else {
@@ -70,10 +70,10 @@ public abstract class Gee.AbstractMultiSet<G> : AbstractCollection<G>, MultiSet<
 	}
 
 	public override bool remove (G item) {
-		if (_nitems > 0 && _storage_map.contains (item)) {
+		if (_nitems > 0 && _storage_map.has_key (item)) {
 			int current_count = _storage_map.get (item);
 			if (current_count <= 1) {
-				_storage_map.remove (item);
+				_storage_map.unset (item);
 			} else {
 				_storage_map.set (item, current_count - 1);
 			}
diff --git a/gee/hashmap.vala b/gee/hashmap.vala
index cbe6d58..de4e990 100644
--- a/gee/hashmap.vala
+++ b/gee/hashmap.vala
@@ -342,7 +342,7 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
 		}
 
 		public override bool contains (K key) {
-			return _map.contains (key);
+			return _map.has_key (key);
 		}
 
 		public override bool add_all (Collection<K> collection) {
@@ -534,7 +534,7 @@ public class Gee.HashMap<K,V> : Gee.AbstractMap<K,V> {
 			assert (_stamp == _map._stamp);
 			assert (_node != null);
 			has_next ();
-			_map.remove (_node.key);
+			_map.unset (_node.key);
 			_node = null;
 			_stamp = _map._stamp;
 		}
diff --git a/gee/map.vala b/gee/map.vala
index 1a2bed7..20c9aa2 100644
--- a/gee/map.vala
+++ b/gee/map.vala
@@ -82,6 +82,7 @@ public interface Gee.Map<K,V> : Object, Iterable<Map.Entry<K,V>> {
 	 *
 	 * @deprecated Use { link has_key} method instead.
 	 */
+	[Deprecated]
 	public abstract bool contains (K key);
 
 	/**
@@ -132,6 +133,7 @@ public interface Gee.Map<K,V> : Object, Iterable<Map.Entry<K,V>> {
 	 *
 	 * @deprecated Use { link unset} method instead.
 	 */
+	[Deprecated]
 	public abstract bool remove (K key, out V? value = null);
 
 	/**
@@ -170,6 +172,7 @@ public interface Gee.Map<K,V> : Object, Iterable<Map.Entry<K,V>> {
 	 *
 	 * @deprecated Use { link unset_all} method instead.
 	 */
+	[Deprecated]
 	public abstract bool remove_all (Map<K,V> map);
 
 	/**
@@ -186,6 +189,7 @@ public interface Gee.Map<K,V> : Object, Iterable<Map.Entry<K,V>> {
 	 *
 	 * @deprecated Use { link has_all} method instead.
 	 */
+	[Deprecated]
 	public abstract bool contains_all (Map<K,V> map);
 
 	/**
diff --git a/gee/treemap.vala b/gee/treemap.vala
index cbd156f..4e4d438 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -477,7 +477,7 @@ public class Gee.TreeMap<K,V> : Gee.AbstractMap<K,V> {
 		}
 
 		public override bool contains (K key) {
-			return _map.contains (key);
+			return _map.has_key (key);
 		}
 
 		public override bool add_all (Collection<K> collection) {



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