protected StringBuilder printDebug ( StringBuilder buf , ClusteringFeature n , int d ) { FormatUtil . appendSpace ( buf , d ) . append ( n . n ) ; for ( int i = 0 ; i < n . getDimensionality ( ) ; i ++ ) { buf . append ( ' ' ) . append ( n . centroid ( i ) ) ; } buf . append ( " - " ) . append ( n . n ) . append ( ' ' ) ; if ( n instanceof TreeNode ) { ClusteringFeature [ ] children = ( ( TreeNode ) n ) . children ; for ( int i = 0 ; i < children . length ; i ++ ) { ClusteringFeature c = children [ i ] ; if ( c != null ) { printDebug ( buf , c , d + 1 ) ; } } } return buf ; }
Utility function for debugging .