ode/src/iterator.cpp
changeset 0 2f259fa3e83a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ode/src/iterator.cpp	Tue Feb 02 01:00:49 2010 +0200
@@ -0,0 +1,27 @@
+#include "set.h"
+
+iterator::iterator(set* sc){
+    current = 1;
+    this->s = sc;
+}
+
+iterator::~iterator(){
+     delete s;
+}
+
+pair iterator::getElem(){
+	return s->getElem(this -> current);
+}
+
+int iterator::hasNext(){
+	if (current == s->length()) return 0;
+	else return 1;
+}
+
+void iterator::next(){
+	if (this->hasNext()) current++;
+}
+
+void iterator::setToFirst(){
+	current = 1;
+}