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