Permalink
Browse files

isolated MongoSequence to keep with the pattern of teh rest of Bluepr…

…ints.
  • Loading branch information...
1 parent 4d9b41d commit 9189d6558e87844df4eac5278d71fe9cc569e49f @okram okram committed Sep 21, 2010
@@ -2,9 +2,9 @@
import com.mongodb.*;
import com.tinkerpop.blueprints.odm.Store;
+import com.tinkerpop.blueprints.odm.impls.mongodb.util.MongoSequence;
import java.net.UnknownHostException;
-import java.util.Iterator;
import java.util.Map;
/**
@@ -56,29 +56,4 @@ public String toString() {
public void shutdown() {
// TODO: what is needed to shutdown a connection in MongoDB?
}
-
- private class MongoSequence implements Iterator<MongoDocument>, Iterable<MongoDocument> {
-
- private final DBCursor cursor;
-
- public MongoSequence(DBCursor cursor) {
- this.cursor = cursor;
- }
-
- public boolean hasNext() {
- return this.cursor.hasNext();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public MongoDocument next() {
- return new MongoDocument(this.cursor.next());
- }
-
- public Iterator<MongoDocument> iterator() {
- return this;
- }
- }
}
@@ -0,0 +1,34 @@
+package com.tinkerpop.blueprints.odm.impls.mongodb.util;
+
+import com.mongodb.DBCursor;
+import com.tinkerpop.blueprints.odm.impls.mongodb.MongoDocument;
+
+import java.util.Iterator;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class MongoSequence implements Iterator<MongoDocument>, Iterable<MongoDocument> {
+
+ private final DBCursor cursor;
+
+ public MongoSequence(DBCursor cursor) {
+ this.cursor = cursor;
+ }
+
+ public boolean hasNext() {
+ return this.cursor.hasNext();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ public MongoDocument next() {
+ return new MongoDocument(this.cursor.next());
+ }
+
+ public Iterator<MongoDocument> iterator() {
+ return this;
+ }
+}

0 comments on commit 9189d65

Please sign in to comment.