[libgee/mapadaptor: 2/2] Add temporary gee/setadaptor.vala



commit d317a61a35c01ee7b25e7de8ff763894550f79b5
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Fri Oct 7 10:18:20 2011 +0100

    Add temporary gee/setadaptor.vala

 gee/setadaptor.vala |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/gee/setadaptor.vala b/gee/setadaptor.vala
new file mode 100644
index 0000000..9fa9b0a
--- /dev/null
+++ b/gee/setadaptor.vala
@@ -0,0 +1,35 @@
+public class Gee.SetAdaptor<G> {
+       public Gee.Iterator<G> iterator() {
+               return Iterator<G> ();
+       }
+
+
+
+       protected class Iterator<G> : Object, Iterator<G> {
+               public Iterator (MapIterator<G, G> map_iterator) {
+                       this.map_iterator = map_iterator;
+               }
+
+               public bool next () {
+                       return map_iterator.next ();
+               }
+
+               public bool has_next () {
+                       return map_iterator.has_next ();
+               }
+
+               public G get () {
+                       return map_iterator.get_key ();
+               }
+
+               public void remove () {
+                       map_iterator.unset ();
+               }
+
+               public bool valid { get { return map_iterator.valid; } }
+
+               public bool read_only { get { return map_iterator.read_only; } }
+
+               protected MapIterator<G, G> map_iterator;
+       }
+}


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