/** * Returns true if the edge is labeled with any of the passed strings. * * @param iLabels Labels as array of Strings * @return true if the edge is labeled with any of the passed strings */ public boolean isLabeled(final String[] iLabels) { return isLabeled(getLabel(), iLabels); }
/** * Returns true if the edge is labeled with any of the passed strings. * * @param iEdge * Edge * @param iLabels * Labels as array of Strings * @return */ protected boolean isLabeled(final String[] iLabels) { return isLabeled(getLabel(), iLabels); }
public boolean filter(final OrientEdge iObject) { return this.vertex.graph.isUseVertexFieldsForEdgeLabels() || iObject.isLabeled(labels); } }
protected void addSingleEdge(final ODocument doc, final OMultiCollectionIterator<Edge> iterable, String fieldName, final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex, final String[] iLabels) { final OrientBaseGraph graph = getGraph(); final OrientEdge toAdd = getEdge(graph, doc, fieldName, connection, fieldValue, iTargetVertex, iLabels); if (toAdd != null && (settings.isUseVertexFieldsForEdgeLabels() || toAdd.isLabeled(iLabels))) // ADD THE EDGE iterable.add(toAdd); }
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); }
@Override public OIdentifiable getGraphElementRecord(final Object iObject) { final ORecord rec = ((OIdentifiable) iObject).getRecord(); if (rec == null || !(rec instanceof ODocument)) return null; final ODocument value = (ODocument) rec; final OIdentifiable v; OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(value); if (immutableClass.isVertexType()) { // DIRECT VERTEX v = value; } else if (immutableClass.isEdgeType()) { // EDGE if (vertex.settings.isUseVertexFieldsForEdgeLabels() || OrientEdge.isLabeled(OrientEdge.getRecordLabel(value), iLabels)) v = OrientEdge.getConnection(value, connection.getKey().opposite()); else v = null; } else throw new IllegalStateException("Invalid content found between connections: " + value); return v; }
+ fieldName + " field: " + fieldRecord); if (graph.isUseVertexFieldsForEdgeLabels() || toAdd.isLabeled(iLabels))
@Override public Vertex createWrapper(final Object iObject) { if (iObject instanceof OrientVertex) return (OrientVertex) iObject; final ODocument value = ((OIdentifiable) iObject).getRecord(); final OrientVertex v; if (value.getSchemaClass().isSubClassOf(OrientVertex.CLASS_NAME)) { // DIRECT VERTEX v = new OrientVertex(vertex.graph, value); } else if (value.getSchemaClass().isSubClassOf(OrientEdge.CLASS_NAME)) { // EDGE if (vertex.graph.isUseVertexFieldsForEdgeLabels() || OrientEdge.isLabeled(OrientEdge.getRecordLabel(value), iLabels)) v = new OrientVertex(vertex.graph, OrientEdge.getConnection(value, connection.getKey().opposite())); else v = null; } else throw new IllegalStateException("Invalid content found between connections:" + value); return v; }
@Override public OrientEdge createWrapper(final Object iObject) { if (iObject instanceof OrientEdge) return (OrientEdge) iObject; final OIdentifiable rec = (OIdentifiable) iObject; final ODocument value = rec.getRecord(); if (value == null || value.getSchemaClass() == null) return null; final OrientEdge edge; if (value.getSchemaClass().isSubClassOf(OrientVertex.CLASS_NAME)) { // DIRECT VERTEX, CREATE DUMMY EDGE if (connection.getKey() == Direction.OUT) edge = new OrientEdge(this.vertex.graph, this.vertex.getIdentity(), rec.getIdentity(), connection.getValue()); else edge = new OrientEdge(this.vertex.graph, rec.getIdentity(), this.vertex.getIdentity(), connection.getValue()); } else if (value.getSchemaClass().isSubClassOf(OrientEdge.CLASS_NAME)) { // EDGE edge = new OrientEdge(this.vertex.graph, rec.getIdentity()); } else throw new IllegalStateException("Invalid content found between connections:" + value); if (this.vertex.graph.isUseVertexFieldsForEdgeLabels() || edge.isLabeled(labels)) return edge; return null; }
|| OrientEdge.isLabeled( OrientEdge.getRecordLabel(fieldRecord), iLabels)) { final OIdentifiable vertexDoc = OrientEdge.getConnection(
} else if (klass.isEdgeType()) { if (settings.isUseVertexFieldsForEdgeLabels() || OrientEdge.isLabeled(OrientEdge.getRecordLabel(fieldRecord), iLabels)) { OIdentifiable vertexDoc = OrientEdge.getConnection(fieldRecord, connection.getKey().opposite()); if (vertexDoc == null) {
throw new IllegalStateException("Invalid content found while iterating edges, value '" + value + "' is not an edge"); if (this.sourceVertex.settings.isUseVertexFieldsForEdgeLabels() || edge.isLabeled(labels)) return edge;