public Iterator<Object> iterator() { return new OrientDynaElementIterator(this.graph, iterator); }
public Object next() { OrientElement currentElement = null; if (!hasNext()) throw new NoSuchElementException(); Object current = itty.next(); if (null == current) throw new NoSuchElementException(); if (current instanceof OIdentifiable) current = ((OIdentifiable) current).getRecord(); if (current instanceof ODocument) { final ODocument currentDocument = (ODocument) current; if (currentDocument.getInternalStatus() == ODocument.STATUS.NOT_LOADED) currentDocument.load(); final OClass schemaClass = ODocumentInternal.getImmutableSchemaClass(currentDocument); if (schemaClass != null && schemaClass.isSubClassOf(graph.getEdgeBaseType())) currentElement = graph.getEdge(currentDocument); else // RETURN VERTEX IN ALL THE CASES, EVEN FOR PROJECTED DOCUMENTS currentElement = graph.getVertex(currentDocument); } if(currentElement==null){ return current; } return currentElement; }
public Object next() { OrientElement currentElement = null; if (!hasNext()) throw new NoSuchElementException(); Object current = itty.next(); if (null == current) throw new NoSuchElementException(); if (current instanceof OIdentifiable) current = ((OIdentifiable) current).getRecord(); if (current instanceof ODocument) { final ODocument currentDocument = (ODocument) current; if (currentDocument.getInternalStatus() == ODocument.STATUS.NOT_LOADED) currentDocument.load(); if (currentDocument.getSchemaClass() == null) return currentDocument; if (currentDocument.getSchemaClass().isSubClassOf(graph.getVertexBaseType())) currentElement = new OrientVertex(graph, currentDocument); else if (currentDocument.getSchemaClass().isSubClassOf(graph.getEdgeBaseType())) currentElement = new OrientEdge(graph, currentDocument); else return currentDocument; } return currentElement; }
public Iterator<Object> iterator() { return new OrientDynaElementIterator(this.graph, iterator); }