/** * @return true if directed is DIRECTED, EITHER or null. Otherwise false. */ @JsonIgnore default boolean isDirected() { return DirectedType.UNDIRECTED != getDirectedType(); }
/** * @return true if directed is UNDIRECTED, EITHER or null. Otherwise false. */ @JsonIgnore default boolean isUndirected() { return DirectedType.DIRECTED != getDirectedType(); }
/** * Note this does not include the matchedVertex field. * * @param that the reference EdgeId with which to compare. * @return {@code true} if this object is the same as the edge * argument; {@code false} otherwise. */ default boolean isEqual(final EdgeId that) { return null != that && (new EqualsBuilder() .append(getDirectedType(), that.getDirectedType()) .append(getSource(), that.getSource()) .append(getDestination(), that.getDestination()) .isEquals()); }
/** * @return true if directed is UNDIRECTED, EITHER or null. Otherwise false. */ @JsonIgnore default boolean isUndirected() { return DirectedType.DIRECTED != getDirectedType(); }
/** * @return true if directed is DIRECTED, EITHER or null. Otherwise false. */ @JsonIgnore default boolean isDirected() { return DirectedType.UNDIRECTED != getDirectedType(); }
/** * Note this does not include the matchedVertex field. * * @param that the reference EdgeId with which to compare. * @return {@code true} if this object is the same as the edge * argument; {@code false} otherwise. */ default boolean isEqual(final EdgeId that) { return null != that && (new EqualsBuilder() .append(getDirectedType(), that.getDirectedType()) .append(getSource(), that.getSource()) .append(getDestination(), that.getDestination()) .isEquals()); }
private List<Range> getRange(final ElementId elementId, final GraphFilters operation, final SeededGraphFilters.IncludeIncomingOutgoingType inOutType) throws RangeFactoryException { if (elementId instanceof EntityId) { return getRange(((EntityId) elementId).getVertex(), operation, operation.getView().hasEdges()); } else { final EdgeId edgeId = (EdgeId) elementId; final List<Range> ranges = new ArrayList<>(); if (operation.getView().hasEdges() && DirectedType.areCompatible(operation.getDirectedType(), edgeId.getDirectedType())) { // EQUALS and RELATED seed matching. final DirectedType directed = DirectedType.and(operation.getDirectedType(), edgeId.getDirectedType()); ranges.addAll(getRange(edgeId.getSource(), edgeId.getDestination(), directed, operation, inOutType)); } // Do related - if operation doesn't have seed matching or it has seed matching equal to RELATED final boolean doRelated = !(operation instanceof SeedMatching) || !SeedMatching.SeedMatchingType.EQUAL.equals(((SeedMatching) operation).getSeedMatching()); if (doRelated && operation.getView().hasEntities()) { // Get Entities related to EdgeIds ranges.addAll(getRange(edgeId.getSource(), operation, false)); ranges.addAll(getRange(edgeId.getDestination(), operation, false)); } return ranges; } }
if (DirectedType.isEither(edgeId.getDirectedType())) { relevantElements.addAll(mapImpl.lookup(new EdgeSeed(edgeId.getSource(), edgeId.getDestination(), false))); relevantElements.addAll(mapImpl.lookup(new EdgeSeed(edgeId.getSource(), edgeId.getDestination(), true)));