• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LBException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.LexGrid.LexBIG.Exceptions.LBException的典型用法代码示例。如果您正苦于以下问题:Java LBException类的具体用法?Java LBException怎么用?Java LBException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LBException类属于org.LexGrid.LexBIG.Exceptions包,在下文中一共展示了LBException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: search

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public ResolvedConceptReferencesIterator search(
       Vector<String> schemes, Vector<String> versions, String matchText, String algorithm, String target) throws LBException {
       if (algorithm == null|| target == null) return null;

       if (algorithm.compareToIgnoreCase(EXACT_MATCH) == 0 && target.compareToIgnoreCase(CODES) == 0) {
		return search(schemes, versions, matchText, BY_CODE, "exactMatch");
       } else if (algorithm.compareToIgnoreCase(LUCENE) == 0 && target.compareToIgnoreCase(CODES) == 0) {
		return search(schemes, versions, matchText, BY_CODE, "exactMatch");


       } else if (algorithm.compareToIgnoreCase(EXACT_MATCH) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
		return search(schemes, versions, matchText, BY_NAME, "exactMatch");


       } else if (algorithm.compareToIgnoreCase(LUCENE) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
		return search(schemes, versions, matchText, BY_NAME, "lucene");
       } else if (algorithm.compareToIgnoreCase(CONTAINS) == 0 && target.compareToIgnoreCase(NAMES) == 0) {
		return search(schemes, versions, matchText, BY_NAME, "contains");
	}
	return null;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:22,代码来源:SimpleSearchUtils.java


示例2: resolveConcepts

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
 * Resolves matching concepts for any word in the given term.
 * @param css The code system to search.
 * @param matchWords The term to match.
 * @return The list of matching references.
 * @throws LBException
 */
protected ResolvedConceptReferencesIterator resolveConcepts(CodingSchemeSummary css, String query) throws LBException {
	// Define a code set over the target terminology and
	// restrict to concepts with matching text based on 
	// the provided term.
	LexBIGService lbs = LexBIGServiceImpl.defaultInstance();
	CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
	csvt.setVersion(css.getRepresentsVersion());
	CodedNodeSet cns = lbs.getCodingSchemeConcepts(css.getLocalName(), csvt);
	
	// Restrict the code set.
	cns.restrictToMatchingDesignations(
			query, SearchDesignationOption.ALL, MatchAlgorithms.LuceneQuery.name(), null);
	
	// Resolve the concepts and assigned text.
	ResolvedConceptReferencesIterator matches = cns.resolve(
			ConvenienceMethods.createSortOptionList(new String[] {SortableProperties.code.name()}),
			null, new PropertyType[] {PropertyType.PRESENTATION});
	return matches;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:27,代码来源:ScoreTerm.java


示例3: doPage

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
@Override
protected List<? extends ResolvedConceptReference> doPage(
		int position,
		int pageSize) {


	List<ResolvedConceptReference> returnList = new ArrayList<ResolvedConceptReference>();
	try {
		while(quickIterator.hasNext() && returnList.size() < pageSize){
			returnList.addAll(this.resolveOneHit(quickIterator.next()));
		}
	} catch (LBException e) {
		throw new RuntimeException(e);
	}
	return returnList;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:SearchByAssociationIteratorDecorator.java


示例4: getSupportedHierarchies

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
protected SupportedHierarchy[] getSupportedHierarchies(
    String codingScheme, CodingSchemeVersionOrTag versionOrTag)
        throws LBException {

    CodingScheme cs = null;
    try {
        cs = getCodingScheme(codingScheme, versionOrTag);
    } catch (Exception ex) {

    }
    if (cs == null) {
        throw new LBResourceUnavailableException(
            "Coding scheme not found -- " + codingScheme);
    }
    Mappings mappings = cs.getMappings();
    return mappings.getSupportedHierarchy();
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:18,代码来源:CodingSchemeDataUtils.java


示例5: getPathsFromRoot

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
 * Resolves one or more paths from the hierarchy root to the given code
 * through a list of connected associations defined by the hierarchy.
 */
protected AssociationList getPathsFromRoot(LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
        String scheme, CodingSchemeVersionOrTag csvt, String hierarchyID, String focusCode,
        Map<String, EntityDescription> codesToDescriptions) throws LBException {

    // Get paths from the focus code to the root from the
    // convenience method.  All paths are resolved.  If only
    // one path is required, it would be possible to use
    // HierarchyPathResolveOption.ONE to reduce processing
    // and improve overall performance.
    AssociationList pathToRoot = lbscm.getHierarchyPathToRoot(scheme, csvt, null, focusCode, false,
            HierarchyPathResolveOption.ALL, null);

    // But for purposes of this example we need to display info
    // in order coming from root direction. Process the paths to root
    // recursively to reverse the order for processing ...
    AssociationList pathFromRoot = new AssociationList();
    for (int i = pathToRoot.getAssociationCount() - 1; i >= 0; i--)
        reverseAssoc(lbsvc, lbscm, scheme, csvt, pathToRoot.getAssociation(i), pathFromRoot, codesToDescriptions);

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


示例6: restrict

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public CodedNodeGraphDirectoryBuilder restrict(AssociationQueryServiceRestrictions restrictions){
	if(restrictions != null && 
			restrictions.getPredicate() != null &&
			restrictions.getPredicate().getEntityName() != null &&
			restrictions.getPredicate().getEntityName().getName() != null){
		String predicateName = restrictions.getPredicate().getEntityName().getName();
		
		try {
			this.updateState(
					this.getState().restrictToAssociations(Constructors.createNameAndValueList(predicateName), null));
		} catch (LBException e) {
			throw new RuntimeException(e);
		}
	}
	
	return this;
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:18,代码来源:CodedNodeGraphDirectoryBuilder.java


示例7: getLexCodingScheme

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public static CodingScheme getLexCodingScheme(
		LexBIGService lexBigService, 
		CodingSchemeRendering lexCodingSchemeRendering) {
	
	CodingScheme lexCodingScheme = null;
	String lexCodingSchemeName = null;
	String lexVersion = null;
	CodingSchemeVersionOrTag lexTagOrVersion = null;
	try {
		if(lexCodingSchemeRendering != null){
			lexCodingSchemeName = lexCodingSchemeRendering.getCodingSchemeSummary().getCodingSchemeURI();			
			lexVersion = lexCodingSchemeRendering.getCodingSchemeSummary().getRepresentsVersion();
			lexTagOrVersion = Constructors.createCodingSchemeVersionOrTagFromVersion(lexVersion);			
		}
		
		lexCodingScheme = lexBigService.resolveCodingScheme(lexCodingSchemeName, lexTagOrVersion);			
		
	} catch (LBException e) {
		throw new RuntimeException(e);
	}
	return lexCodingScheme;
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:23,代码来源:CommonResourceUtils.java


示例8: createMockedResolveCodingScheme

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
private void createMockedResolveCodingScheme(LexBIGService lexBigService) throws LBException{
	EasyMock.expect(lexBigService.resolveCodingScheme((String) EasyMock.anyObject(), (CodingSchemeVersionOrTag) EasyMock.anyObject())).andAnswer(
		    new IAnswer<CodingScheme>() {
		        @Override
		        public CodingScheme answer() throws Throwable {		        	
		        	String codingSchemeName =  (String) EasyMock.getCurrentArguments()[0];
		        	CodingSchemeVersionOrTag tagOrVersion = (CodingSchemeVersionOrTag) EasyMock.getCurrentArguments()[1];
		        	CodingScheme codingScheme = new CodingScheme();
		        	
		        	//TODO: Need to set the values with correct data
		        	codingScheme.setCodingSchemeName(codingSchemeName);
		        	codingScheme.setRepresentsVersion(tagOrVersion.getVersion());
		        	codingScheme.setCodingSchemeURI("");
		        	codingScheme.setFormalName("");
		        	codingScheme.setLocalName(new String[0]);
		        	return codingScheme;
		        }
		    }
		).anyTimes();
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:21,代码来源:FakeLexEvsSystem.java


示例9: run2

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
    _displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
    String codes[] = new String[] {
            "C32221", "C38626", "C13043", "C32949", "C12275",
            "C25763", "C34070", "C62484", "C34022",
            "C13024", "C13091", "C32224",
    };
    
    for (int i=0; i<codes.length; ++i) {
        if (i > 0) {
            Util.displayMessage("");
            Util.displayMessage(SEPARATOR);
        }
        process(codes[i]);
    }
    Util.displayMessage("Done");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:18,代码来源:FindRelatedCodes2.java


示例10: numOfChildren

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
protected int numOfChildren(String code) throws LBException {
    ResolvedConceptReferenceList list = getMatches(code, HAS_SUBTYPE, false);
    if (list.getResolvedConceptReferenceCount() <= 0)
        return 0;
    
    ResolvedConceptReference ref = (ResolvedConceptReference) 
        list.enumerateResolvedConceptReference().nextElement();

    AssociationList aList = ref.getSourceOf();
    Association[] associations = aList.getAssociation();
    int n = 0;
    for (int i = 0; i < associations.length; i++) {
        Association assoc = associations[i];
        AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
        n += acl.length;
    }
    return n;
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:19,代码来源:FindRelatedCodes2.java


示例11: run

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run()throws LBException{
    if (_css == null)
        return;

    String word = "cell";
    while (true) {
        word = Prompt.prompt("Word (q to Quit)", word);
        if (word.equalsIgnoreCase("q"))
            break;
        
        _displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
        process(word);

        Util.displayMessage("");
        Util.displayMessage(SEPARATOR);
    }
    Util.displayMessage("Quit");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:19,代码来源:MetaMatch2.java


示例12: run2

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
    String words[] = new String[] {
        "cell", "blood"
    };
    
    _displayConcepts = Prompt.prompt("Display Concepts", _displayConcepts);
    for (int i=0; i<words.length; ++i) {
        if (i > 0) {
            Util.displayMessage("");
            Util.displayMessage(SEPARATOR);
        }
        Util.displayMessage("*** Keyword: " + words[i]);
        process(words[i]);
    }
    Util.displayMessage("Done");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:17,代码来源:MetaMatch2.java


示例13: printChain

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
 * Displays the given concept chain, taking into account any branches
 * that might be imbedded.
 * @param assoc
 * @param depth
 * @throws LBException
 */
protected void printChain(Association assoc, int depth) throws LBException {
	StringBuffer indent = new StringBuffer();
	for (int i = 0; i <= depth; i++)
		indent.append("    ");

	AssociatedConceptList concepts = assoc.getAssociatedConcepts();
	for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
		// Print focus of this branch ...
		AssociatedConcept concept = concepts.getAssociatedConcept(i);
		Util.displayMessage(
				new StringBuffer(indent)
					.append(assoc.getAssociationName()).append("->")
					.append(concept.getConceptCode()).append(':')
					.append(concept.getEntityDescription() == null ? "NO DESCRIPTION" : concept.getEntityDescription().getContent())
					.toString());

		// Find and recurse printing for next batch ...
		AssociationList nextLevel = concept.getSourceOf();
		if (nextLevel != null && nextLevel.getAssociationCount() != 0)
			for (int j = 0; j < nextLevel.getAssociationCount(); j++)
				printChain(nextLevel.getAssociation(j), depth + 1);
	}
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:31,代码来源:ListHierarchyPathToRoot.java


示例14: run2

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
    int maxDepth = 3;
    boolean displayConcepts = Prompt.prompt("Display Concepts", true);
    String codes[] = new String[] {
        "C32221", "C38626", "C13043", "C32949", "C12275",
        "C25763", "C34070", "C62484", "C34022",
        "C13024", "C13091", "C32224",
    };
    
    for (int i=0; i<codes.length; ++i) {
        if (i > 0) {
            Util.displayMessage("");
            Util.displayMessage(SEPARATOR);
        }
        process(codes[i], maxDepth, displayConcepts);
    }
    Util.displayMessage("Done");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:19,代码来源:ListHierarchy2.java


示例15: getConceptByCode

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
  * Get concept Entity by code
  * @param codingScheme
  * @param code
  * @return
  */
 public ResolvedConceptReference getConceptByCode(String codingScheme, String version,
 		String code) {
     CodedNodeSet cns = null;
     ResolvedConceptReferencesIterator iterator = null;

     try {
LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
         CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
         if (version != null) csvt.setVersion(version);

         cns = lbSvc.getCodingSchemeConcepts(codingScheme, csvt);
         ConceptReferenceList crefs =
             createConceptReferenceList(new String[] { code }, codingScheme);
         cns.restrictToCodes(crefs);
         iterator = cns.resolve(null, null, null);
         if (iterator.numberRemaining() > 0) {
             ResolvedConceptReference ref = (ResolvedConceptReference) iterator.next();
             return ref;
         }
     } catch (LBException e) {
         _logger.info("Error: " + e.getMessage());
     }

     return null;
 }
 
开发者ID:NCIP,项目名称:nci-mapping-tool,代码行数:32,代码来源:SearchCart.java


示例16: run2

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void run2() throws LBException {
    String codes[] = new String[] {
        //"C13043", "C32949", "C12275", "C12753", "C38366", "C69305"

        //"C32221", "C38626", "C13043", "C32949", "C12275",
        //"C25763", "C34070", "C62484", "C34022",
        //"C13024", "C13091", "C32224",
        
        "C40312", "C40291", "C6840", "C66933", "C6217", "C9370",
        "C6207"
    };
    
    boolean displayConcepts = Prompt.prompt("Display Concepts", true);
    for (int i=0; i<codes.length; ++i) {
        if (i > 0) {
            Util.displayMessage("");
            Util.displayMessage(SEPARATOR);
        }
        process(codes[i], displayConcepts);
    }
    Util.displayMessage("Done");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:23,代码来源:ListHierarchyPathToRoot2.java


示例17: printChain

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
 * Displays the given concept chain, taking into account any branches
 * that might be imbedded.
 * @param assoc
 * @param depth
 * @throws LBException
 */
protected void printChain(Association assoc, int depth, boolean displayConcepts)
    throws LBException {
    StringBuffer indent = new StringBuffer();
    for (int i = 0; i <= depth; i++)
        indent.append(INDENT);

    AssociatedConceptList concepts = assoc.getAssociatedConcepts();
    for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
        // Print focus of this branch ...
        AssociatedConcept concept = concepts.getAssociatedConcept(i);
        String desc = concept.getEntityDescription() == null ? 
                "NO DESCRIPTION" : concept.getEntityDescription().getContent();
        if (displayConcepts)
            _buffer.append(indent + assoc.getAssociationName() + "->" +
                concept.getConceptCode() + ":" + desc + "\n");

        // Find and recurse printing for next batch ...
        AssociationList nextLevel = concept.getSourceOf();
        if (nextLevel != null && nextLevel.getAssociationCount() != 0)
            for (int j = 0; j < nextLevel.getAssociationCount(); j++)
                printChain(nextLevel.getAssociation(j), depth + 1, displayConcepts);
    }
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:31,代码来源:ListHierarchyPathToRoot2.java


示例18: buildCaches

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public void buildCaches() throws Exception {
	this.valueSetToNameVersionMap.clear();
	this.uriToValueSetToNameVersionMap.clear();
	
	try {
		for(CodingScheme codingScheme : this.lexEVSResolvedService.listAllResolvedValueSets()){
			String valueSetId = codingScheme.getFormalName();
			String valueSetDefId = 
				ValueSetDefinitionUtils.getValueSetDefinitionLocalId(codingScheme.getCodingSchemeURI());
			String localId = RESOLVED_VS_LOCAL_ID;
			
			ResolvedValueSetNameTriple triple = 
				new ResolvedValueSetNameTriple(valueSetId, valueSetDefId, localId);
			
			this.valueSetToNameVersionMap.put(
				triple, 
				new NameVersionPair(codingScheme.getFormalName(), codingScheme.getRepresentsVersion()));
			
			this.uriToValueSetToNameVersionMap.put(codingScheme.getCodingSchemeURI(), triple);
		}
	} catch (LBException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:NCIP,项目名称:lexevs-service,代码行数:25,代码来源:DefaultResolvedValueSetNameTranslator.java


示例19: driver

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
public static void driver(String code) throws LBException {
    AppService service = AppService.getInstance();
    LexBIGService lbsvc = AppService.getLBSvc();
    LexBIGServiceConvenienceMethods lbscm = service.getLBSCM();
    String scheme = service.getScheme();
    CodingSchemeVersionOrTag csvt = service.getCSVT();
    
    String hierarchyID = "is_a";
    SupportedHierarchy hierarchyDefn = getSupportedHierarchy(lbsvc, scheme, csvt, hierarchyID);
    BuildTreeForCode2 test = new BuildTreeForCode2();

    excelBuffer.replace(0, excelBuffer.length(), "");
    excelPostBuffer.replace(0, excelPostBuffer.length(), "");
    Util.StopWatch stopWatch = new Util.StopWatch();
    test.process(code);
    Util_displayMessage("===========================================================");
    test.run(lbsvc, lbscm, scheme, csvt, hierarchyDefn, code);
    long duration = stopWatch.duration();
    println(stopWatch.getResult(duration) + " * Round trip");            
    excelBuffer.append(stopWatch.getSecondString(duration) + "\t");
    excelBuffer.append(excelPostBuffer.toString());
    excelPrintln(excelBuffer.toString());
    println("");
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:25,代码来源:BuildTreeForCode2.java


示例20: printChain

import org.LexGrid.LexBIG.Exceptions.LBException; //导入依赖的package包/类
/**
 * Displays the given concept chain, taking into account any branches that
 * might be imbedded.
 *
 * @param assoc
 * @param depth
 * @throws LBException
 */
protected void printChain(Association assoc, int depth) throws LBException {
    StringBuffer indent = new StringBuffer();
    for (int i = 0; i <= depth; i++)
        indent.append("    ");

    AssociatedConceptList concepts = assoc.getAssociatedConcepts();
    for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
        // Print focus of this branch ...
        AssociatedConcept concept = concepts.getAssociatedConcept(i);
        Util_displayMessage(new StringBuffer(indent).append(assoc.getAssociationName()).append("->").append(
                concept.getConceptCode()).append(':').append(
                concept.getEntityDescription() == null ? "NO DESCRIPTION" : concept.getEntityDescription()
                        .getContent()).toString());

        // Find and recurse printing for next batch ...
        AssociationList nextLevel = concept.getSourceOf();
        if (nextLevel != null && nextLevel.getAssociationCount() != 0)
            for (int j = 0; j < nextLevel.getAssociationCount(); j++)
                printChain(nextLevel.getAssociation(j), depth + 1);
    }
}
 
开发者ID:NCIP,项目名称:nci-term-browser,代码行数:30,代码来源:BuildTreeForCode.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultMapEntry类代码示例发布时间:2022-05-22
下一篇:
Java UntrustedIdentityException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap