[libgee] Make Iterable.get_element_type a property



commit adb24babf0c051600c7db1ba51a9153b60a085da
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Fri Jul 31 14:59:01 2009 +0200

    Make Iterable.get_element_type a property
    
    Fixes bug 589551.

 gee/abstractcollection.vala |    4 ++--
 gee/iterable.vala           |    6 ++----
 gee/readonlycollection.vala |    4 ++--
 gee/readonlylist.vala       |    4 ++--
 gee/readonlyset.vala        |    4 ++--
 5 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/gee/abstractcollection.vala b/gee/abstractcollection.vala
index bcc7063..6171cd9 100644
--- a/gee/abstractcollection.vala
+++ b/gee/abstractcollection.vala
@@ -53,8 +53,8 @@ public abstract class Gee.AbstractCollection<G> : Object, Iterable<G>, Collectio
 	// Inherited from Iterable<G>
 	//
 
-	public Type get_element_type () {
-		return typeof (G);
+	public Type element_type {
+		get { return typeof (G); }
 	}
 
 	public abstract Iterator<G> iterator ();
diff --git a/gee/iterable.vala b/gee/iterable.vala
index a966236..2726325 100644
--- a/gee/iterable.vala
+++ b/gee/iterable.vala
@@ -28,11 +28,9 @@ using GLib;
  */
 public interface Gee.Iterable<G> : GLib.Object {
 	/**
-	 * Returns the type of the elements contained in this collection.
-	 *
-	 * @return the type of the elements contained in this collection
+	 * The type of the elements in this collection.
 	 */
-	public abstract Type get_element_type ();
+	public abstract Type element_type { get; }
 
 	/**
 	 * Returns a Iterator that can be used for simple iteration over a
diff --git a/gee/readonlycollection.vala b/gee/readonlycollection.vala
index 9c5c99b..5ed2da9 100644
--- a/gee/readonlycollection.vala
+++ b/gee/readonlycollection.vala
@@ -40,8 +40,8 @@ public class Gee.ReadOnlyCollection<G> : Object, Iterable<G>, Collection<G> {
 		this.collection = collection;
 	}
 
-	public Type get_element_type () {
-		return typeof (G);
+	public Type element_type {
+		get { return typeof (G); }
 	}
 
 	public Gee.Iterator<G> iterator () {
diff --git a/gee/readonlylist.vala b/gee/readonlylist.vala
index 9b1f147..2c4f1e5 100644
--- a/gee/readonlylist.vala
+++ b/gee/readonlylist.vala
@@ -40,8 +40,8 @@ public class Gee.ReadOnlyList<G> : Object, Iterable<G>, Collection<G>, List<G> {
 		this.list = list;
 	}
 
-	public Type get_element_type () {
-		return typeof (G);
+	public Type element_type {
+		get { return typeof (G); }
 	}
 
 	public Gee.Iterator<G> iterator () {
diff --git a/gee/readonlyset.vala b/gee/readonlyset.vala
index a02c356..a2e6572 100644
--- a/gee/readonlyset.vala
+++ b/gee/readonlyset.vala
@@ -40,8 +40,8 @@ public class Gee.ReadOnlySet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
 		this.set = set;
 	}
 
-	public Type get_element_type () {
-		return typeof (G);
+	public Type element_type {
+		get { return typeof (G); }
 	}
 
 	public Gee.Iterator<G> iterator () {



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