Get the first successor reachable from given edge type.

@param source
the source block
@param edgeType
the edge type leading to the successor
@return the successor, or null if there is no outgoing edge with the
specified edge type
773400
public BasicBlock getSuccessorWithEdgeType(BasicBlock source, @Type int edgeType) {
        Edge edge = getOutgoingEdgeWithType(source, edgeType);
        return edge != null ? edge.getTarget() : null;
    }
1041
public static <T> DiGraphIterator<T> getInstance(T root, Function<? super T, ? extends Collection<T>> edges)
    {
        return new DiGraphIterator<>(root, (y)->edges.apply(y).stream());
    }
645655
private String getPropertyName(final String targetTypeName, final boolean outgoing, final String relationshipTypeName, final Cardinality cardinality) {

		final String sourceTypeName   = getName();
		final String relatedClassName = outgoing ? targetTypeName : sourceTypeName;

		String _sourceMultiplicity = null;
		String _targetMultiplicity = null;

		switch (cardinality) {

			case OneToOne:
				_sourceMultiplicity = "1";
				_targetMultiplicity = "1";
				break;

			case OneToMany:
				_sourceMultiplicity = "1";
				_targetMultiplicity = "*";
				break;

			case ManyToOne:
				_sourceMultiplicity = "*";
				_targetMultiplicity = "1";
				break;

			case ManyToMany:
				_sourceMultiplicity = "*";
				_targetMultiplicity = "*";
				break;
		}

		return SchemaRelationshipNode.getPropertyName(relatedClassName, root.getExistingPropertyNames(), outgoing, relationshipTypeName, sourceTypeName, targetTypeName, null, _targetMultiplicity, null, _sourceMultiplicity);
	}
843124
public Object get(IConverter converter, Object sourceObject,
			TypeReference<?> destinationType) {
		return convertedObjects.get(new ConvertedObjectsKey(converter,
				sourceObject, destinationType));
	}
42555
public Iterator<AtlasEdge> getAdjacentEdgesByLabel(AtlasVertex instanceVertex, AtlasEdgeDirection direction, final String edgeLabel) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Finding edges for {} with label {}", string(instanceVertex), edgeLabel);
        }

        if(instanceVertex != null && edgeLabel != null) {
            final Iterator<AtlasEdge> iterator = instanceVertex.getEdges(direction).iterator();
            return new Iterator<AtlasEdge>() {
                private AtlasEdge edge = null;

                @Override
                public boolean hasNext() {
                    while (edge == null && iterator.hasNext()) {
                        AtlasEdge localEdge = iterator.next();
                        if (localEdge.getLabel().equals(edgeLabel)) {
                            edge = localEdge;
                        }
                    }
                    return edge != null;
                }

                @Override
                public AtlasEdge next() {
                    if (hasNext()) {
                        AtlasEdge localEdge = edge;
                        edge = null;
                        return localEdge;
                    }
                    return null;
                }

                @Override
                public void remove() {
                    throw new IllegalStateException("Not handled");
                }
            };
        }
        return null;
    }
1272234
@SuppressWarnings({ "unchecked", "rawtypes" })
	public <NV> Graph<K, VV, NV> mapEdges(final MapFunction<Edge<K, EV>, NV> mapper) {

		TypeInformation<K> keyType = ((TupleTypeInfo<?>) edges.getType()).getTypeAt(0);

		TypeInformation<NV> valueType;

		if (mapper instanceof ResultTypeQueryable) {
			valueType = ((ResultTypeQueryable) mapper).getProducedType();
		} else {
			valueType = TypeExtractor.createTypeInfo(MapFunction.class, mapper.getClass(), 1, edges.getType(), null);
		}

		TypeInformation<Edge<K, NV>> returnType = (TypeInformation<Edge<K, NV>>) new TupleTypeInfo(
				Edge.class, keyType, keyType, valueType);

		return mapEdges(mapper, returnType);
	}
1019061
public int getNode(Source source)
  {

//    if (source instanceof DOMSource)
//      return ((DOMSource) source).getNode();

    // TODO: Not sure if the BaseID is really the same thing as the ID.
    String url = source.getSystemId();

    if (null == url)
      return DTM.NULL;

    int n = m_sourceTree.size();

    // System.out.println("getNode: "+n);
    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      // System.out.println("getNode -         url: "+url);
      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
      if (url.equals(sTree.m_url))
        return sTree.m_root;
    }

    // System.out.println("getNode - returning: "+node);
    return DTM.NULL;
  }
167697
private static Type findGenericInterface(Class<?> sourceClass, Class<?> targetBaseInterface) {
        for (int i = 0; i < sourceClass.getInterfaces().length; i++) {
            Class<?> inter = sourceClass.getInterfaces()[i];
            if (inter == targetBaseInterface) {
                return sourceClass.getGenericInterfaces()[0];
            } else {
                Type deeper = findGenericInterface(inter, targetBaseInterface);
                if (deeper != null) {
                    return deeper;
                }
            }
        }
        return null;
    }
717776
@Override
    public InheritanceEdge createEdge(ClassVertex source, ClassVertex target) {
        if (!target.isInterface()) {
            source.setDirectSuperclass(target);
        }
        return super.createEdge(source, target);
    }
466215
public static IType findParameterizedTypeInHierarchy( IType sourceType, IType rawGenericType )
  {
    if( sourceType == null )
    {
      return null;
    }

    if( sourceType.isParameterizedType() && sourceType.getGenericType().equals( rawGenericType ) )
    {
      return sourceType;
    }

    IType[] list = sourceType.getInterfaces();
    for( int i = 0; i < list.length; i++ )
    {
      IType returnType = findParameterizedTypeInHierarchy( list[i], rawGenericType );
      if( returnType != null )
      {
        return returnType;
      }
    }

    return findParameterizedTypeInHierarchy( sourceType.getSupertype(), rawGenericType );
  }
1145869
def get_downstream_causal_subgraph(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]):
    
    return get_subgraph_by_edge_filter(graph, build_downstream_edge_predicate(nbunch))
153214
public LinkedList<PlanNode> getPathTo( PlanNode descendant ) {
        assert descendant != null;
        LinkedList<PlanNode> stack = new LinkedList<PlanNode>();
        PlanNode node = descendant;
        while (node != this) {
            stack.addFirst(node);
            node = node.getParent();
            assert node != null : "The supplied node is not a descendant of this node";
        }
        stack.addFirst(this);
        return stack;
    }
1148865
public static IterationBuilderOver over(Class<? extends WindupVertexFrame> sourceType, String source)
    {
        Iteration iterationImpl = new Iteration(new TypedNamedFramesSelector(sourceType, source));
        iterationImpl.setPayloadManager(new TypedNamedIterationPayloadManager(sourceType,
                    singleVariableIterationName(source)));
        return iterationImpl;
    }
642267
EdgeIteratorState copyProperties(EdgeIteratorState from, CommonEdgeIterator to) {
        boolean reverse = from.get(REVERSE_STATE);
        if (to.reverse)
            reverse = !reverse;
        // in case reverse is true we have to swap the nodes to store flags correctly in its "storage direction"
        int nodeA = reverse ? from.getAdjNode() : from.getBaseNode();
        int nodeB = reverse ? from.getBaseNode() : from.getAdjNode();
        long edgePointer = edgeAccess.toPointer(to.getEdge());
        int linkA = reverse ? edgeAccess.getLinkB(edgePointer) : edgeAccess.getLinkA(edgePointer);
        int linkB = reverse ? edgeAccess.getLinkA(edgePointer) : edgeAccess.getLinkB(edgePointer);
        edgeAccess.writeEdge(to.getEdge(), nodeA, nodeB, linkA, linkB);
        edgeAccess.writeFlags(edgePointer, from.getFlags());

        // copy the rest with higher level API
        to.setDistance(from.getDistance()).
                setName(from.getName()).
                setWayGeometry(from.fetchWayGeometry(0));

        if (E_ADDITIONAL >= 0)
            to.setAdditionalField(from.getAdditionalField());
        return to;
    }
1041789
@Override
    public/* final */Fact getFactOnEdge(Edge edge) throws DataflowAnalysisException {
        BasicBlock block = isForwards() ? edge.getSource() : edge.getTarget();

        Fact predFact = createFact();
        copy(getResultFact(block), predFact);

        edgeTransfer(edge, predFact);

        Fact result = createFact();
        makeFactTop(result);
        if (this instanceof UnconditionalValueDerefAnalysis) {
            ((UnconditionalValueDerefAnalysis)this).meetInto((UnconditionalValueDerefSet)predFact,
                    edge, (UnconditionalValueDerefSet)result, true);
        } else {
            meetInto(predFact, edge, result);
        }


        return result;
    }
173418
private static double getEdgeFragmentCost(Node node, Arborescence<Node> arborescence,
                                              Map<Node, Map<Node, Fragment>> edgeToFragment) {

        Fragment fragment = getEdgeFragment(node, arborescence, edgeToFragment);
        if (fragment != null) return fragment.fragmentCost();

        return 0D;
    }
59162
public static <T> T findFirstNextByType(FaceletHandler nextHandler, Class<T> type)
    {
        if (type.isAssignableFrom(nextHandler.getClass()))
        {
            return (T)nextHandler;
        }
        else if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler)
        {
            for (FaceletHandler handler :
                    ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers())
            {
                if (type.isAssignableFrom(handler.getClass()))
                {
                    return (T)handler;
                }
            }
        }
        return null;
    }