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