本文整理汇总了Java中org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList.iterateResolvedConceptReference方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedConceptReferenceList.iterateResolvedConceptReference方法的具体用法?Java ResolvedConceptReferenceList.iterateResolvedConceptReference怎么用?Java ResolvedConceptReferenceList.iterateResolvedConceptReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList
的用法示例。
在下文中一共展示了ResolvedConceptReferenceList.iterateResolvedConceptReference方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printChain
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Handles recursive display of hierarchical relations for the given set of nodes,
* up to the maximum specified depth.
* @param lbscm
* @param scheme
* @param sab
* @param csvt,
* @param rootNodes
* @param maxDepth
* @throws LBException
*/
protected void printChain(
LexBIGServiceConvenienceMethods lbscm,
String scheme,
String sab,
CodingSchemeVersionOrTag csvt,
ResolvedConceptReferenceList rootNodes,
int maxDepth) throws LBException
{
for (Iterator<ResolvedConceptReference> nodes = rootNodes.iterateResolvedConceptReference(); nodes.hasNext(); )
printChainForNode(lbscm, scheme, sab, csvt, nodes.next(), 0, maxDepth, null);
}
示例2: addChildren
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Populate child nodes for a single branch of the tree,
* and indicates whether further expansion (to grandchildren)
* is possible.
*/
protected void addChildren(TreeItem ti,
LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt,
String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
boolean associationsNavigatedFwd)
throws LBException {
// Resolve the next branch, representing children of the given
// code, navigated according to the provided relationship and
// direction. Resolve the children as a code graph, looking 2
// levels deep but leaving the final level unresolved.
CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
/*
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
// to be reversed after loading the patch
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);
// The resolved branch will be represented by the first node in
// the resolved list. The node will be subdivided by source or
// target associations (depending on direction). The associated
// nodes define the children.
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
}
示例3: getAssociationTargets
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
public HashMap getAssociationTargets(String scheme, String version, String code, String assocName)
{
HashMap hmap = new HashMap();
TreeItem ti = null;
long ms = System.currentTimeMillis();
Util.StopWatch stopWatch = new Util.StopWatch(); //DYEE
Set<String> codesToExclude = Collections.EMPTY_SET;
CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
if (version != null) csvt.setVersion(version);
ResolvedConceptReferenceList matches = null;
Vector v = new Vector();
try {
//EVSApplicationService lbSvc = new RemoteServerUtil().createLexBIGService();
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
LexBIGServiceConvenienceMethods lbscm = (LexBIGServiceConvenienceMethods) lbSvc
.getGenericExtension("LexBIGServiceConvenienceMethods");
lbscm.setLexBIGService(lbSvc);
String name = getCodeDescription(lbSvc, scheme, csvt, code);
ti = new TreeItem(code, name);
ti.expandable = false;
CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(code, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(assocName), null);
boolean associationsNavigatedFwd = true;
/*
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
*/
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, false);
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
ti.expandable = true;
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
hmap.put(code, ti);
} catch (Exception ex) {
ex.printStackTrace();
}
_logger.debug("Run time (milliseconds) getSubconcepts: " + (System.currentTimeMillis() - ms) + " to resolve " );
_logger.debug("DYEE: getSubconcepts: " + stopWatch.getResult() + " to resolve " );
return hmap;
}
示例4: addChildren
import org.LexGrid.LexBIG.DataModel.Collections.ResolvedConceptReferenceList; //导入方法依赖的package包/类
/**
* Populate child nodes for a single branch of the tree,
* and indicates whether further expansion (to grandchildren)
* is possible.
*/
protected void addChildren(TreeItem ti,
LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
String scheme, CodingSchemeVersionOrTag csvt,
String branchRootCode, Set<String> codesToExclude, String[] associationsToNavigate,
boolean associationsNavigatedFwd)
throws LBException {
// Resolve the next branch, representing children of the given
// code, navigated according to the provided relationship and
// direction. Resolve the children as a code graph, looking 2
// levels deep but leaving the final level unresolved.
CodedNodeGraph cng = lbsvc.getNodeGraph(scheme, csvt, null);
ConceptReference focus = Constructors.createConceptReference(branchRootCode, scheme);
cng = cng.restrictToAssociations(Constructors.createNameAndValueList(associationsToNavigate), null);
ResolvedConceptReferenceList branch = cng.resolveAsList(focus, associationsNavigatedFwd,
!associationsNavigatedFwd, -1, 2, noopList_, null, null, null, -1, true);
// The resolved branch will be represented by the first node in
// the resolved list. The node will be subdivided by source or
// target associations (depending on direction). The associated
// nodes define the children.
for (Iterator<ResolvedConceptReference> nodes = branch.iterateResolvedConceptReference(); nodes.hasNext();) {
ResolvedConceptReference node = nodes.next();
AssociationList childAssociationList = associationsNavigatedFwd ? node.getSourceOf() : node.getTargetOf();
// Process each association defining children ...
for (Iterator<Association> pathsToChildren = childAssociationList.iterateAssociation(); pathsToChildren.hasNext();) {
Association child = pathsToChildren.next();
String childNavText = getDirectionalLabel(lbscm, scheme, csvt, child, associationsNavigatedFwd);
// Each association may have multiple children ...
AssociatedConceptList branchItemList = child.getAssociatedConcepts();
for (Iterator<AssociatedConcept> branchNodes = branchItemList.iterateAssociatedConcept(); branchNodes
.hasNext();) {
AssociatedConcept branchItemNode = branchNodes.next();
String branchItemCode = branchItemNode.getConceptCode();
// Add here if not in the list of excluded codes.
// This is also where we look to see if another level
// was indicated to be available. If so, mark the
// entry with a '+' to indicate it can be expanded.
if (!codesToExclude.contains(branchItemCode)) {
TreeItem childItem = new TreeItem(branchItemCode, getCodeDescription(branchItemNode));
AssociationList grandchildBranch =
associationsNavigatedFwd
? branchItemNode.getSourceOf()
: branchItemNode.getTargetOf();
if (grandchildBranch != null)
childItem.expandable = true;
ti.addChild(childNavText, childItem);
}
}
}
}
}