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); }
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; }
/** * 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); }
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; }
/** * 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); }
/** * 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()); }
/** * 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); } }
@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) ); }
private int writeEdge(final Edge edge, final GroupType type) throws SerialisationException { int currentFieldIndex = writeGafferObject(ParquetStoreConstants.SOURCE, edge.getSource(), type, 0); currentFieldIndex = writeGafferObject(ParquetStoreConstants.DESTINATION, edge.getDestination(), type, currentFieldIndex); recordConsumer.startField(ParquetStoreConstants.DIRECTED, currentFieldIndex); recordConsumer.addBoolean(edge.getDirectedType().isDirected()); recordConsumer.endField(ParquetStoreConstants.DIRECTED, currentFieldIndex); return currentFieldIndex + 1; }
? ClassicBytePositions.INCORRECT_WAY_DIRECTED_EDGE : ClassicBytePositions.UNDIRECTED_EDGE; } else if (directed.isDirected()) { if (inOutType == IncludeIncomingOutgoingType.INCOMING) { directionFlag1 = ClassicBytePositions.INCORRECT_WAY_DIRECTED_EDGE;
fields.appendElem(null); } else { fields.appendElem(((Edge) element).getDirectedType().isDirected());