當前位置: 首頁>>代碼示例>>Java>>正文


Java Vertex類代碼示例

本文整理匯總了Java中org.codehaus.plexus.util.dag.Vertex的典型用法代碼示例。如果您正苦於以下問題:Java Vertex類的具體用法?Java Vertex怎麽用?Java Vertex使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Vertex類屬於org.codehaus.plexus.util.dag包,在下文中一共展示了Vertex類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addDependsOn

import org.codehaus.plexus.util.dag.Vertex; //導入依賴的package包/類
/**
 * Add dependency information to the srvModel
 *
 * @param srvModel
 * @throws CycleDetectedException
 * @throws ContextException
 */
private void addDependsOn(SrvModel srvModel, List<String> sortedEntries) throws ContextException {
    for (String entryName : sortedEntries) {
        // Only those that are args in the srvModel
        if (!srvModel.getData().keySet().contains(entryName)) continue;
        Vertex vertex = dag.getVertex(entryName);
        if (vertex.getParentLabels() != null && vertex.getParentLabels().size() > 0) {
            List<String> paths = new ArrayList<String>();
            for (String dependent : vertex.getParentLabels()) {
                if (entryToResultMap.containsKey(dependent)) {
                    Vertex depVertex = dag.getVertex(dependent);
                    if (depVertex.getParentLabels()!=null) {
                        for (String depInternal : depVertex.getParentLabels()) {
                            if (entryToResultMap.containsKey(depInternal)) {
                                paths.add(entryToResultMap.get(depInternal));
                            }
                        }
                    }
                }
            }
            if (paths.size()>0) {
                dependsOn((Dependency)srvModel, dep(entryName, paths(paths.toArray())));
                String topNode = entryName;
                if (entryToResultMap.containsKey(entryName))
                    topNode = entryToResultMap.get(entryName);
                if (!topNodes.contains(topNode))
                    topNodes.add(entryName);
            }
        }
    }
}
 
開發者ID:mwsobol,項目名稱:SORCER,代碼行數:38,代碼來源:SrvModelAutoDeps.java

示例2: addEdge

import org.codehaus.plexus.util.dag.Vertex; //導入依賴的package包/類
private void addEdge( Vertex fromVertex, Vertex toVertex, MavenProject fromProject,
                      Map<String, MavenProject> projectMap, boolean force, boolean safe )
    throws CycleDetectedException
{
    if ( fromVertex.equals( toVertex ) )
    {
        return;
    }

    if ( fromProject != null )
    {
        MavenProject toProject = projectMap.get( toVertex.getLabel() );
        fromProject.addProjectReference( toProject );
    }

    if ( force && toVertex.getChildren().contains( fromVertex ) )
    {
        dag.removeEdge( toVertex, fromVertex );
    }

    try
    {
        dag.addEdge( fromVertex, toVertex );
    }
    catch ( CycleDetectedException e )
    {
        if ( !safe )
        {
            throw e;
        }
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:33,代碼來源:ProjectSorter.java


注:本文中的org.codehaus.plexus.util.dag.Vertex類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。