software/test/performance/src/org/LexGrid/LexBIG/example/remote2/ListHierarchyPathToRoot2.java
/**
     * Displays the given concept chain, taking into account any branches
     * that might be imbedded.
     * @param assoc
     * @param depth
     * @throws LBException
     */
Displays the given concept chain, taking into account any branches
that might be imbedded.
@param assoc
@param depth
@throws LBException
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++) {
            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");
            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);
        }
    }
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 ++ ) { 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" ) ; 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 ) ; } }
Displays the given concept chain, taking into account any branches
 that might be imbedded.
Displays the given concept chain taking into account any branches that might be imbedded .
// Print focus of this branch ...
 // Find and recurse printing for next batch ...
