DirectedGraph<String, DefaultEdge> namespaceDAG = new DirectedMultigraph<>(DefaultEdge.class); extensionsUsedInApp.forEach(namespace -> fillDependencyGraph(namespaceDAG, namespace, allExtensionsByNamespace)); GraphIterator<String, DefaultEdge> graphIterator = new TopologicalOrderIterator<>(namespaceDAG);
/** * No-arg constructor meant for JAXB. */ private SIGraph () { super(new DirectedMultigraph(Relation.class), true /* reuseEvents */); }
ListenableDirectedMultigraph(Class<E> edgeClass) { super(new DirectedMultigraph<V, E>(edgeClass)); } }
/** * Empty constructor. */ public StateFlowGraph() { sfg = new DirectedMultigraph<StateVertex, Eventable>(Eventable.class); }
ListenableDirectedMultigraph(Class<E> edgeClass) { super(new DirectedMultigraph<V, E>(edgeClass)); } }
/** * Creates a new SIGraph object at system level. * * @param system the containing system */ public SIGraph (SystemInfo system) { super(new DirectedMultigraph(Relation.class), true /* reuseEvents */); Objects.requireNonNull(system, "A sig needs a non-null system"); this.system = system; }
/** * Create a builder for this kind of graph. * * @param edgeClass class on which to base factory for edges * @param <V> the graph vertex type * @param <E> the graph edge type * @return a builder for this kind of graph */ public static <V, E> GraphBuilder<V, E, ? extends DirectedMultigraph<V, E>> createBuilder( Class<? extends E> edgeClass) { return new GraphBuilder<>(new DirectedMultigraph<>(edgeClass)); }
/** * Create a builder for this kind of graph. * * @param edgeSupplier the edge supplier of the new graph * @param <V> the graph vertex type * @param <E> the graph edge type * @return a builder for this kind of graph */ public static <V, E> GraphBuilder<V, E, ? extends DirectedMultigraph<V, E>> createBuilder( Supplier<E> edgeSupplier) { return new GraphBuilder<>(new DirectedMultigraph<>(null, edgeSupplier, false)); }
public ExpressionGraph() { this.searchOrder = SearchOrder.ReverseTopological; this.graph = new DirectedMultigraph( new ClassBasedEdgeFactory( PathScopeExpression.class ) ); this.allowNonRecursiveMatching = true; }
public ExpressionGraph( SearchOrder searchOrder, boolean allowNonRecursiveMatching ) { this.searchOrder = searchOrder; this.graph = new DirectedMultigraph( new ClassBasedEdgeFactory( PathScopeExpression.class ) ); this.allowNonRecursiveMatching = allowNonRecursiveMatching; }
DirectedGraph<String, DefaultEdge> namespaceDAG = new DirectedMultigraph<>(DefaultEdge.class); extensionsUsedInApp.stream().forEach(namespace -> fillDependencyGraph(namespaceDAG, namespace, allExtensionsByNamespace)); GraphIterator<String, DefaultEdge> graphIterator = new TopologicalOrderIterator<>(namespaceDAG);
public void addSuperclass(String className, String superName, int access) { String classNameWithDots = ResourceList.getClassNameFromResourcePath(className); String superNameWithDots = ResourceList.getClassNameFromResourcePath(superName); if (inheritanceGraph == null) { inheritanceGraph = new DirectedMultigraph<>( DefaultEdge.class); } inheritanceGraph.addVertex(classNameWithDots); inheritanceGraph.addVertex(superNameWithDots); inheritanceGraph.addEdge(superNameWithDots, classNameWithDots); }
public void printBoundGraph( String filename ) { LOG.info( "writing stream bound graph to {}", filename ); DirectedMultigraph<Duct, Integer> graph = new DirectedMultigraph<>( new EdgeFactory<Duct, Integer>() { int count = 0; @Override public Integer createEdge( Duct sourceVertex, Duct targetVertex ) { return count++; } } ); TopologicalOrderIterator<Duct, Integer> iterator = getTopologicalOrderIterator(); while( iterator.hasNext() ) { Duct previous = iterator.next(); if( graph.containsVertex( previous ) || previous instanceof Extent ) continue; graph.addVertex( previous ); addNext( graph, previous ); } Util.printGraph( filename, graph ); }
graph = new DirectedMultigraph<>(null, null, false); ArrayList<HashSet<Arc>> tmp = new ArrayList<>(totalSizes); for (int i = 0; i < totalSizes; i++) {
graph = new DirectedMultigraph<>(null, null, false); ArrayList<HashSet<Arc>> tmp = new ArrayList<>(totalSizes); for (int i = 0; i < totalSizes; i++)
return new DirectedWeightedMultigraph<>(vertexSupplier, edgeSupplier); } else { return new DirectedMultigraph<>(vertexSupplier, edgeSupplier, false);
graph = new DirectedMultigraph<>(null, null, false); ArrayList<HashSet<Arc>> tmp = new ArrayList<>(totalSizes); for (int i = 0; i < totalSizes; i++)
return new DirectedWeightedMultigraph<>(edgeClass); } else { return new DirectedMultigraph<>(edgeClass);