protected Object e2v(final OrientBaseGraph graph, final OIdentifiable iRecord, final Direction iDirection, final String[] iLabels) { final ODocument rec = iRecord.getRecord(); OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(rec); if (clazz != null && clazz.isEdgeType()) { // EDGE final OrientEdge edge = graph.getEdge(rec); if (edge != null) { if (Direction.BOTH.equals(iDirection)) { Set<Vertex> result = new HashSet<Vertex>(); result.add(edge.getVertex(Direction.OUT)); result.add(edge.getVertex(Direction.IN)); return result; } else { return edge.getVertex(iDirection); } } } return null; } }
public String toString() { graph.setCurrentGraphInThreadLocal(); if (getLabel() == null) return StringFactory.E + StringFactory.L_BRACKET + getId() + StringFactory.R_BRACKET + StringFactory.L_BRACKET + getVertex(Direction.OUT).getId() + StringFactory.ARROW + getVertex(Direction.IN).getId() + StringFactory.R_BRACKET; return StringFactory.edgeString(this); }
/** * Returns a string representation of the edge. */ public String toString() { if (setCurrentGraphInThreadLocal() != null) { if (getLabel() == null) return StringFactory.E + StringFactory.L_BRACKET + getId() + StringFactory.R_BRACKET + StringFactory.L_BRACKET + getVertex( Direction.OUT).getId() + StringFactory.ARROW + getVertex(Direction.IN).getId() + StringFactory.R_BRACKET; return StringFactory.edgeString(this); } else return StringFactory.E + StringFactory.L_BRACKET + getId(); }
public boolean filter(final OrientEdge iObject) { if (targetVertex != null && !targetVertex.equals(iObject.getVertex(connection.getKey().opposite()))) return false; return this.sourceVertex.settings.isUseVertexFieldsForEdgeLabels() || iObject.isLabeled(labels); }
private void writeEdge(OrientEdge edge, OJSONWriter json) throws IOException { json.beginObject(); json.writeAttribute("@rid", edge.getIdentity()); json.writeAttribute("@class", edge.getRecord().getClassName()); json.writeAttribute("out", edge.getVertex(Direction.OUT).getId()); json.writeAttribute("in", edge.getVertex(Direction.IN).getId()); for (String field : edge.getPropertyKeys()) { final Object v = edge.getProperty(field); if (v != null) json.writeAttribute(field, v); } json.endObject(); } }
OrientEdge edge = graph.getEdge(entry); rsEdges.add(edge); vertices.add(graph.getVertex(edge.getVertex(Direction.IN))); vertices.add(graph.getVertex(edge.getVertex(Direction.OUT))); } else continue; if (!vertices.contains(edge.getVertex(Direction.OUT)) || !vertices.contains(edge.getVertex(Direction.IN))) if (!vertices.contains(edge.getVertex(Direction.OUT)) || !vertices.contains(edge.getVertex(Direction.IN)))