当前位置: 首页>>代码示例>>Java>>正文


Java SupportedHierarchy.getLocalId方法代码示例

本文整理汇总了Java中org.LexGrid.naming.SupportedHierarchy.getLocalId方法的典型用法代码示例。如果您正苦于以下问题:Java SupportedHierarchy.getLocalId方法的具体用法?Java SupportedHierarchy.getLocalId怎么用?Java SupportedHierarchy.getLocalId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.LexGrid.naming.SupportedHierarchy的用法示例。


在下文中一共展示了SupportedHierarchy.getLocalId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTreePathData

import org.LexGrid.naming.SupportedHierarchy; //导入方法依赖的package包/类
public HashMap getTreePathData(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
        CodingSchemeVersionOrTag csvt, SupportedHierarchy hierarchyDefn, String focusCode) throws LBException {
    HashMap hmap = new HashMap();
    TreeItem ti = new TreeItem("<Root>", "Root node");
    long ms = System.currentTimeMillis();
    int pathsResolved = 0;
    try {

        // Resolve 'is_a' hierarchy info. This example will
        // need to make some calls outside of what is covered
        // by existing convenience methods, but we use the
        // registered hierarchy to prevent need to hard code
        // relationship and direction info used on lookup ...
        String hierarchyID = hierarchyDefn.getLocalId();
        String[] associationsToNavigate = hierarchyDefn.getAssociationIds();
        boolean associationsNavigatedFwd = hierarchyDefn.getIsForwardNavigable();

        // Identify the set of all codes on path from root
        // to the focus code ...
        Map<String, EntityDescription> codesToDescriptions = new HashMap<String, EntityDescription>();
        AssociationList pathsFromRoot = getPathsFromRoot(lbsvc, lbscm, scheme, csvt, hierarchyID, focusCode,
                codesToDescriptions);

        // Typically there will be one path, but handle multiple just in
        // case.  Each path from root provides a 'backbone', from focus
        // code to root, for additional nodes to hang off of in our
        // printout. For every backbone node, one level of children is
        // printed, along with an indication of whether those nodes can
        // be expanded.
        for (Iterator<Association> paths = pathsFromRoot.iterateAssociation(); paths.hasNext();) {
            addPathFromRoot(ti, lbsvc, lbscm, scheme, csvt, paths.next(), associationsToNavigate, associationsNavigatedFwd,
                    codesToDescriptions);
            pathsResolved++;
        }

    } finally {
        _logger.debug("Run time (milliseconds): " + (System.currentTimeMillis() - ms) +
            " to resolve " + pathsResolved + " paths from root.");
    }

    hmap.put(focusCode, ti);

    // Print the result ..
    return hmap;

}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:47,代码来源:TreeUtils.java

示例2: run

import org.LexGrid.naming.SupportedHierarchy; //导入方法依赖的package包/类
/**
     * Prints the tree for an individual code.
     */
    public void run(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
            CodingSchemeVersionOrTag csvt, SupportedHierarchy hierarchyDefn, String focusCode) throws LBException {

        // Print a header and define a new tree for the code being processed.
        Util_displayMessage("============================================================");
        Util_displayMessage("Focus code: " + focusCode);
        Util_displayMessage("============================================================");

        TreeItem ti = new TreeItem("<Root>", "Root node");
        //long ms = System.currentTimeMillis();
        Util.StopWatch stopWatch = new Util.StopWatch();
        int pathsResolved = 0;
        try {

            // Resolve 'is_a' hierarchy info. This example will
            // need to make some calls outside of what is covered
            // by existing convenience methods, but we use the
            // registered hierarchy to prevent need to hard code
            // relationship and direction info used on lookup ...
            String hierarchyID = hierarchyDefn.getLocalId();
            //String[] associationsToNavigate = hierarchyDefn.getAssociationNames();
            String[] associationsToNavigate = hierarchyDefn.getAssociationIds();
            boolean associationsNavigatedFwd = hierarchyDefn.getIsForwardNavigable();

            // Identify the set of all codes on path from root
            // to the focus code ...
            Map<String, EntityDescription> codesToDescriptions = new HashMap<String, EntityDescription>();
            AssociationList pathsFromRoot = getPathsFromRoot(lbsvc, lbscm, scheme, csvt, hierarchyID, focusCode,
                    codesToDescriptions);

            // Typically there will be one path, but handle multiple just in
            // case.  Each path from root provides a 'backbone', from focus
            // code to root, for additional nodes to hang off of in our
            // printout. For every backbone node, one level of children is
            // printed, along with an indication of whether those nodes can
            // be expanded.
            for (Iterator<Association> paths = pathsFromRoot.iterateAssociation(); paths.hasNext();) {
                addPathFromRoot(ti, lbsvc, lbscm, scheme, csvt, paths.next(), associationsToNavigate, associationsNavigatedFwd,
                        codesToDescriptions);
                pathsResolved++;
            }

        } finally {
            long duration = stopWatch.duration();
//            println("Run time (milliseconds): " + (System.currentTimeMillis() - ms) +
//                " to resolve " + pathsResolved + " paths from root.");
            println(stopWatch.getResult(duration) +
                    " * To resolve " + pathsResolved + " paths from root.");
            excelBuffer.append(pathsResolved + "\t");
            excelBuffer.append(stopWatch.getSecondString(duration) + "\t");
        }

        // Print the result ..
        printTree(ti, focusCode, 0);
    }
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:59,代码来源:BuildTreeForCode2.java

示例3: run

import org.LexGrid.naming.SupportedHierarchy; //导入方法依赖的package包/类
/**
 * Prints the tree for an individual code.
 */
public void run(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm, String scheme,
        CodingSchemeVersionOrTag csvt, SupportedHierarchy hierarchyDefn, String focusCode) throws LBException {

    // Print a header and define a new tree for the code being processed.
    Util_displayMessage("============================================================");
    Util_displayMessage("Focus code: " + focusCode);
    Util_displayMessage("============================================================");

    TreeItem ti = new TreeItem("<Root>", "Root node");
    long ms = System.currentTimeMillis();
    int pathsResolved = 0;
    try {

        // Resolve 'is_a' hierarchy info. This example will
        // need to make some calls outside of what is covered
        // by existing convenience methods, but we use the
        // registered hierarchy to prevent need to hard code
        // relationship and direction info used on lookup ...
        String hierarchyID = hierarchyDefn.getLocalId();
        //String[] associationsToNavigate = hierarchyDefn.getAssociationNames();
        String[] associationsToNavigate = hierarchyDefn.getAssociationIds();
        boolean associationsNavigatedFwd = hierarchyDefn.getIsForwardNavigable();

        // Identify the set of all codes on path from root
        // to the focus code ...
        Map<String, EntityDescription> codesToDescriptions = new HashMap<String, EntityDescription>();
        AssociationList pathsFromRoot = getPathsFromRoot(lbsvc, lbscm, scheme, csvt, hierarchyID, focusCode,
                codesToDescriptions);

        // Typically there will be one path, but handle multiple just in
        // case.  Each path from root provides a 'backbone', from focus
        // code to root, for additional nodes to hang off of in our
        // printout. For every backbone node, one level of children is
        // printed, along with an indication of whether those nodes can
        // be expanded.
        for (Iterator<Association> paths = pathsFromRoot.iterateAssociation(); paths.hasNext();) {
            addPathFromRoot(ti, lbsvc, lbscm, scheme, csvt, paths.next(), associationsToNavigate, associationsNavigatedFwd,
                    codesToDescriptions);
            pathsResolved++;
        }

    } finally {
        System.out.println("Run time (milliseconds): " + (System.currentTimeMillis() - ms) +
            " to resolve " + pathsResolved + " paths from root.");
    }

    // Print the result ..
    printTree(ti, focusCode, 0);
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:53,代码来源:BuildTreeForCode.java


注:本文中的org.LexGrid.naming.SupportedHierarchy.getLocalId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。