]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
add get_element_type method to Gee.Iterable
authorJuerg Billeter <j@bitron.ch>
Tue, 22 Jan 2008 13:18:05 +0000 (13:18 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 22 Jan 2008 13:18:05 +0000 (13:18 +0000)
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

svn path=/trunk/; revision=882

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

index 53a3e133e91de429252714daa1d31169830124df..4faf959ec7f86e328cb94e57020f703a3c9c4991 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-22  Jürg 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
+
 2008-01-22  Jürg Billeter  <j@bitron.ch>
 
        * vapigen/valagidlparser.vala: support cheader_filename metadata
index b5e83da6581ab80bab5108c1ed75677938656557..4a49b48e2ae876204c8992c3ca87d614e86daa5a 100644 (file)
@@ -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 class Gee.ArrayList<G> : Object, Iterable<G>, Collection<G>, List<G> {
        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);
        }
index 2de53250f7d20bec9b69d22f90736b2d36e6e90d..c6cd0f94077065604f1429e59fe28fd68c762b1d 100644 (file)
@@ -188,6 +188,10 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
                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 class Gee.HashMap<K,V> : Object, Map<K,V> {
                public ValueCollection (construct HashMap! map) {
                }
 
+               public Type get_element_type () {
+                       return typeof (V);
+               }
+
                public Iterator<V> iterator () {
                        return new ValueIterator<K,V> (_map);
                }
index ad076bd4fa1d882bb4fbead3f74bc9ecf53d4a6c..afa674d1d482cb3c978ee38386d1504d1cecfe81 100644 (file)
@@ -75,6 +75,10 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
                return (*node != null);
        }
 
+       public Type get_element_type () {
+               return typeof (G);
+       }
+
        public Gee.Iterator<G> iterator () {
                return new Iterator<G> (this);
        }
index 2b9176df6114b8a858fb9c784b995cfd153bba8f..ca13109c2d527dcca9d85acb862c4046ff7c28c3 100644 (file)
@@ -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
  *     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.
index ecf9002932287680ac22a3ea0b913c584c87d6b4..eaee2b0e000f39be1cf6729e2fd989fdba17497d 100644 (file)
@@ -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 class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> {
        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> ();
index 4f8741f5f2824264ea9c0e37db077c3836f7ea76..a7b187a284b37d416522944bfbb3990d97507cc5 100644 (file)
@@ -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 class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> {
        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> ();
index edd8a06f8cabcb95843dbe93955d295b99e03756..492ec80b4f33db37c33400e0306c857a39e8f650 100644 (file)
@@ -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 class Gee.ReadOnlySet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
        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> ();