vala r882 - in trunk: . gee



Author: juergbi
Date: Tue Jan 22 13:18:05 2008
New Revision: 882
URL: http://svn.gnome.org/viewvc/vala?rev=882&view=rev

Log:
2008-01-22  Juerg Billeter  <j bitron ch>

	* gee/arraylist.vala, gee/hashmap.vala, gee/hashset.vala,
	  gee/iterable.vala, gee/readonlycollection.vala, gee/readonlylist.vala,
	  gee/readonlyset.vala: add get_element_type method to Gee.Iterable


Modified:
   trunk/ChangeLog
   trunk/gee/arraylist.vala
   trunk/gee/hashmap.vala
   trunk/gee/hashset.vala
   trunk/gee/iterable.vala
   trunk/gee/readonlycollection.vala
   trunk/gee/readonlylist.vala
   trunk/gee/readonlyset.vala

Modified: trunk/gee/arraylist.vala
==============================================================================
--- trunk/gee/arraylist.vala	(original)
+++ trunk/gee/arraylist.vala	Tue Jan 22 13:18:05 2008
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2004-2005  Novell, Inc
  * Copyright (C) 2005  David Waite
- * Copyright (C) 2007  JÃrg Billeter
+ * Copyright (C) 2007-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -46,6 +46,10 @@
 	public ArrayList (construct EqualFunc equal_func = GLib.direct_equal) {
 	}
 
+	public Type get_element_type () {
+		return typeof (G);
+	}
+
 	public Gee.Iterator<G> iterator () {
 		return new Iterator<G> (this);
 	}

Modified: trunk/gee/hashmap.vala
==============================================================================
--- trunk/gee/hashmap.vala	(original)
+++ trunk/gee/hashmap.vala	Tue Jan 22 13:18:05 2008
@@ -188,6 +188,10 @@
 		public KeySet (construct HashMap! map) {
 		}
 
+		public Type get_element_type () {
+			return typeof (K);
+		}
+
 		public Iterator<K> iterator () {
 			return new KeyIterator<K,V> (_map);
 		}
@@ -261,6 +265,10 @@
 		public ValueCollection (construct HashMap! map) {
 		}
 
+		public Type get_element_type () {
+			return typeof (V);
+		}
+
 		public Iterator<V> iterator () {
 			return new ValueIterator<K,V> (_map);
 		}

Modified: trunk/gee/hashset.vala
==============================================================================
--- trunk/gee/hashset.vala	(original)
+++ trunk/gee/hashset.vala	Tue Jan 22 13:18:05 2008
@@ -75,6 +75,10 @@
 		return (*node != null);
 	}
 
+	public Type get_element_type () {
+		return typeof (G);
+	}
+
 	public Gee.Iterator<G> iterator () {
 		return new Iterator<G> (this);
 	}

Modified: trunk/gee/iterable.vala
==============================================================================
--- trunk/gee/iterable.vala	(original)
+++ trunk/gee/iterable.vala	Tue Jan 22 13:18:05 2008
@@ -1,6 +1,6 @@
 /* iterable.vala
  *
- * Copyright (C) 2007  JÃrg Billeter
+ * Copyright (C) 2007-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,11 +20,15 @@
  * 	JÃrg Billeter <j bitron ch>
  */
 
+using GLib;
+
 /**
  * Implemented by classes that support a simple iteration over instances of the
  * collection.
  */
 public interface Gee.Iterable<G> : GLib.Object {
+	public abstract Type get_element_type ();
+
 	/**
 	 * Returns a Iterator that can be used for simple iteration over a
 	 * collection.

Modified: trunk/gee/readonlycollection.vala
==============================================================================
--- trunk/gee/readonlycollection.vala	(original)
+++ trunk/gee/readonlycollection.vala	Tue Jan 22 13:18:05 2008
@@ -1,6 +1,6 @@
 /* readonlycollection.vala
  *
- * Copyright (C) 2007  JÃrg Billeter
+ * Copyright (C) 2007-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,10 @@
 	public ReadOnlyCollection (construct Collection<G> collection = null) {
 	}
 
+	public Type get_element_type () {
+		return typeof (G);
+	}
+
 	public Gee.Iterator<G> iterator () {
 		if (_collection == null) {
 			return new Iterator<G> ();

Modified: trunk/gee/readonlylist.vala
==============================================================================
--- trunk/gee/readonlylist.vala	(original)
+++ trunk/gee/readonlylist.vala	Tue Jan 22 13:18:05 2008
@@ -1,6 +1,6 @@
 /* readonlylist.vala
  *
- * Copyright (C) 2007  JÃrg Billeter
+ * Copyright (C) 2007-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,10 @@
 	public ReadOnlyList (construct List<G> list = null) {
 	}
 
+	public Type get_element_type () {
+		return typeof (G);
+	}
+
 	public Gee.Iterator<G> iterator () {
 		if (_list == null) {
 			return new Iterator<G> ();

Modified: trunk/gee/readonlyset.vala
==============================================================================
--- trunk/gee/readonlyset.vala	(original)
+++ trunk/gee/readonlyset.vala	Tue Jan 22 13:18:05 2008
@@ -1,6 +1,6 @@
 /* readonlyset.vala
  *
- * Copyright (C) 2007  JÃrg Billeter
+ * Copyright (C) 2007-2008  JÃrg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,10 @@
 	public ReadOnlySet (construct Set<G> set = null) {
 	}
 
+	public Type get_element_type () {
+		return typeof (G);
+	}
+
 	public Gee.Iterator<G> iterator () {
 		if (_set == null) {
 			return new Iterator<G> ();



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