public ExpressionGraph arcs( ElementExpression... matchers ) { ElementExpression lhs = null; for( ElementExpression matcher : matchers ) { graph.addVertex( matcher ); if( lhs != null ) graph.addEdge( lhs, matcher ); lhs = matcher; } return this; }
public ExpressionGraph arc( ElementExpression lhsMatcher, ScopeExpression scopeMatcher, ElementExpression rhsMatcher ) { graph.addVertex( lhsMatcher ); graph.addVertex( rhsMatcher ); // can never re-use edges, must be wrapped graph.addEdge( lhsMatcher, rhsMatcher, new DelegateScopeExpression( scopeMatcher ) ); return this; }
public void addInterface(String className, String interfaceName) { String classNameWithDots = ResourceList.getClassNameFromResourcePath(className); String interfaceNameWithDots = ResourceList.getClassNameFromResourcePath(interfaceName); inheritanceGraph.addVertex(classNameWithDots); inheritanceGraph.addVertex(interfaceNameWithDots); inheritanceGraph.addEdge(interfaceNameWithDots, classNameWithDots); interfacesSet.add(interfaceNameWithDots); }
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); }
private void addNext( DirectedMultigraph graph, Duct previous ) { if( previous instanceof Fork ) { for( Duct next : ( (Fork) previous ).getAllNext() ) { if( next == null || next instanceof Extent ) continue; graph.addVertex( next ); if( graph.containsEdge( previous, next ) ) continue; graph.addEdge( previous, next ); addNext( graph, next ); } } else { Duct next = previous.getNext(); if( next == null || next instanceof Extent ) return; graph.addVertex( next ); if( graph.containsEdge( previous, next ) ) return; graph.addEdge( previous, next ); addNext( graph, next ); } } }
graph.addEdge(a, b, arc); tmp.get(idx).add(arc);