software/test/performance/src/org/LexGrid/LexBIG/example/ListHierarchyMetaBySource.java
/**
	 * Handles recursive display of hierarchy for an individual node,
	 * up to the maximum specified depth.
	 * @param lbscm
	 * @param scheme
	 * @param sab
	 * @param csvt
	 * @param ref
	 * @param currentDepth
	 * @param maxDepth
	 * @param assocName
	 * @throws LBException
	 */
Handles recursive display of hierarchy for an individual node,
up to the maximum specified depth.
Handles recursive display of hierarchy for an individual node up to the maximum specified depth .
protected void printChainForNode(
			LexBIGServiceConvenienceMethods lbscm,
			String scheme,
			String sab,
			CodingSchemeVersionOrTag csvt,
			ResolvedConceptReference ref,
			int currentDepth,
			int maxDepth,
			String assocName) throws LBException
	{
		StringBuffer indent = new StringBuffer();
		for (int i = 0; i <= currentDepth; i++)
			indent.append("    ");
		String code = ref.getConceptCode();
		EntityDescription desc = ref.getEntityDescription();
		Util.displayMessage(new StringBuffer()
			.append(indent)
			.append(assocName != null ? (assocName+"->") : "")
			.append(code).append(':').append(desc != null ? desc.getContent() : "")
			.toString());
		if (currentDepth < maxDepth) {
			AssociationList aList = lbscm.getHierarchyLevelNext(
				scheme, csvt, null, code, false,
				ConvenienceMethods.createNameAndValueList(sab, "Source"));
			for (int i = 0; i < aList.getAssociationCount(); i++) {
				Association assoc = aList.getAssociation(i);
				AssociatedConceptList acList = assoc.getAssociatedConcepts();
				for (Iterator<AssociatedConcept> nodes = acList.iterateAssociatedConcept(); nodes.hasNext(); ) {
					printChainForNode(lbscm, scheme, sab, csvt, nodes.next(), currentDepth + 1, maxDepth, assoc.getDirectionalName());
				}
			}
		}
	}
protected void printChainForNode ( LexBIGServiceConvenienceMethods lbscm , String scheme , String sab , CodingSchemeVersionOrTag csvt , ResolvedConceptReference ref , int currentDepth , int maxDepth , String assocName ) throws LBException { StringBuffer indent = new StringBuffer ( ) ; for ( int i = 0 ; i <= currentDepth ; i ++ ) indent . append ( "    " ) ; String code = ref . getConceptCode ( ) ; EntityDescription desc = ref . getEntityDescription ( ) ; Util . displayMessage ( new StringBuffer ( ) . append ( indent ) . append ( assocName != null ? ( assocName + "->" ) : "" ) . append ( code ) . append ( ':' ) . append ( desc != null ? desc . getContent ( ) : "" ) . toString ( ) ) ; if ( currentDepth < maxDepth ) { AssociationList aList = lbscm . getHierarchyLevelNext ( scheme , csvt , null , code , false , ConvenienceMethods . createNameAndValueList ( sab , "Source" ) ) ; for ( int i = 0 ; i < aList . getAssociationCount ( ) ; i ++ ) { Association assoc = aList . getAssociation ( i ) ; AssociatedConceptList acList = assoc . getAssociatedConcepts ( ) ; for ( Iterator < AssociatedConcept > nodes = acList . iterateAssociatedConcept ( ) ; nodes . hasNext ( ) ; ) { printChainForNode ( lbscm , scheme , sab , csvt , nodes . next ( ) , currentDepth + 1 , maxDepth , assoc . getDirectionalName ( ) ) ; } } } }
Handles recursive display of hierarchy for an individual node,
 up to the maximum specified depth.
Handles recursive display of hierarchy for an individual node up to the maximum specified depth .
// Print the referenced node; indent based on current depth ...
