public static boolean isDirected(final DirectedType directedType) { return null == directedType || directedType.isDirected(); }
public static boolean areCompatible(final DirectedType dirType1, final DirectedType dirType2) { if (DIRECTED == dirType1) { return dirType2.isDirected(); } else if (UNDIRECTED == dirType1) { return dirType2.isUndirected(); } return true; }
@Override protected List<Range> getRange(final Object sourceVal, final Object destVal, final DirectedType directed, final GraphFilters operation, final IncludeIncomingOutgoingType inOutType) throws RangeFactoryException { // To do EITHER we need to create 2 ranges if (DirectedType.isEither(directed)) { return Arrays.asList( new Range(getKeyFromEdgeId(sourceVal, destVal, false, false), true, getKeyFromEdgeId(sourceVal, destVal, false, true), true), new Range(getKeyFromEdgeId(sourceVal, destVal, true, false), true, getKeyFromEdgeId(sourceVal, destVal, true, true), true) ); } return Collections.singletonList( new Range(getKeyFromEdgeId(sourceVal, destVal, directed.isDirected(), false), true, getKeyFromEdgeId(sourceVal, destVal, directed.isDirected(), true), true) ); }
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)));
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; } }
public static boolean isUndirected(final DirectedType directedType) { return null == directedType || directedType.isUndirected(); }
return false; if (!((Edge) element).getDirectedType().equals(((Edge) element2).getDirectedType())) { return false;
final boolean endKey) throws RangeFactoryException { final byte directionFlag1; if (DirectedType.isEither(directed)) { } else if (directed.isDirected()) { if (inOutType == IncludeIncomingOutgoingType.INCOMING) { directionFlag1 = ClassicBytePositions.INCORRECT_WAY_DIRECTED_EDGE;
&& (DirectedType.isEither(directedType)) && !deduplicateUndirectedEdges) { LOGGER.debug("Returning null from getEdgeEntityDirectionFilterIteratorSetting ("
public static boolean isUndirected(final DirectedType directedType) { return null == directedType || directedType.isUndirected(); }
private static boolean getDirected(final Boolean directed, final DirectedType directedType) { if (null != directed) { if (null != directedType) { throw new IllegalArgumentException("Use either 'directed' or 'directedType' - not both."); } return directed; } return DirectedType.isDirected(directedType); }
public static boolean areCompatible(final DirectedType dirType1, final DirectedType dirType2) { if (DIRECTED == dirType1) { return dirType2.isDirected(); } else if (UNDIRECTED == dirType1) { return dirType2.isUndirected(); } return true; }
&& DirectedType.isEither(directedType) && (null == inOutType || inOutType == SeededGraphFilters.IncludeIncomingOutgoingType.EITHER) && includeEntities && !deduplicateUndirectedEdges) {
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { setIdentifiers(source, destination, directedType.isDirected()); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType * @param matchedVertex the vertex that matched a query seed */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex) { setIdentifiers(source, destination, directedType.isDirected(), matchedVertex); }
/** * This may cause undirected edges to be inconsistent as the source and * destination values may not be ordered correctly. * * @param identifierType the identifier type to update * @param value the identifier value */ @Override void putIdentifier(final IdentifierType identifierType, final Object value) { switch (identifierType) { case GROUP: setGroup((String) value); break; case SOURCE: case MATCHED_VERTEX: source = value; break; case DESTINATION: case ADJACENT_MATCHED_VERTEX: destination = value; break; case DIRECTED: directed = (null != value && (value instanceof Boolean && (boolean) value) || (value instanceof DirectedType && ((DirectedType) value).isDirected())); break; default: LOGGER.error("Unknown identifier type: {} detected.", identifierType); } }
public static boolean isDirected(final DirectedType directedType) { return null == directedType || directedType.isDirected(); }
private static boolean getDirected(final Boolean directed, final DirectedType directedType) { if (null != directed) { if (null != directedType) { throw new IllegalArgumentException("Use either 'directed' or 'directedType' - not both."); } return directed; } return DirectedType.isDirected(directedType); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType) { setIdentifiers(source, destination, directedType.isDirected()); }
/** * Sets the identifiers for an Edge. * <p> * If the edge is undirected the the source and destination vertices may get * swapped to ensure undirected edges are consistently constructed. * </p> * * @param source the source vertex * @param destination the destination vertex * @param directedType the edge directedType * @param matchedVertex the vertex that matched a query seed */ @Override public void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex) { setIdentifiers(source, destination, directedType.isDirected(), matchedVertex); }