public final void printInitialClusteringChanges(File file,List<ClusterData> clusterData,int[] matIndexToMsgInternalId) throws AdeUsageException {
  if (m_initialClusters == null) {
    return;
  }
  final PrintWriter out=FileUtils.openPrintWriterToFile(file,true);
  if (m_finalClusters == null) {
    updateClusters(clusterData,matIndexToMsgInternalId);
  }
  int countNoChange=0;
  int countContained=0;
  for (  Map.Entry<String,ArrayList<Integer>> entry : m_initialClusters.entrySet()) {
    final String name=entry.getKey();
    final ArrayList<Integer> members=entry.getValue();
    out.printf("%s %s ",name,members);
    int countC=0;
    boolean splitFlag=true;
    final ArrayList<String> names=new ArrayList<String>();
    for (    Map.Entry<String,Collection<Integer>> newEntry : m_finalClusters.entrySet()) {
      final Collection<Integer> newMembers=newEntry.getValue();
      final String newName=newEntry.getKey();
      int countM=0;
      boolean updateC=true;
      for (      int m : newMembers) {
        if (members.contains(matIndexToMsgInternalId[m])) {
          if (updateC) {
            countC++;
            updateC=false;
            names.add(newName);
          }
          countM++;
        }
      }
      if (countM == members.size()) {
        splitFlag=false;
        if (members.size() == newMembers.size()) {
          out.printf(" did not change.%n");
          countNoChange++;
        }
 else {
          out.printf(" is contained in %s.%n",newName);
          countContained++;
        }
        break;
      }
    }
    if (splitFlag) {
      out.printf("split to %d clusters: %s%n",countC,names);
    }
  }
  out.printf("Summary:%n%d clusters did not change.%n%d clusters are contained.%n%d clusters split.%n",countNoChange,countContained,m_initialClusters.size() - countNoChange - countContained);
  out.close();
}

public final void printInitialClusteringChanges ( File file , List < ClusterData > clusterData , int [ ] matIndexToMsgInternalId ) throws AdeUsageException { if ( m_initialClusters == null ) { return ; } final PrintWriter out = FileUtils . openPrintWriterToFile ( file , true ) ; if ( m_finalClusters == null ) { updateClusters ( clusterData , matIndexToMsgInternalId ) ; } int countNoChange = 0 ; int countContained = 0 ; for ( Map . Entry < String , ArrayList < Integer > > entry : m_initialClusters . entrySet ( ) ) { final String name = entry . getKey ( ) ; final ArrayList < Integer > members = entry . getValue ( ) ; out . printf ( "%s %s " , name , members ) ; int countC = 0 ; boolean splitFlag = true ; final ArrayList < String > names = new ArrayList < String > ( ) ; for ( Map . Entry < String , Collection < Integer > > newEntry : m_finalClusters . entrySet ( ) ) { final Collection < Integer > newMembers = newEntry . getValue ( ) ; final String newName = newEntry . getKey ( ) ; int countM = 0 ; boolean updateC = true ; for ( int m : newMembers ) { if ( members . contains ( matIndexToMsgInternalId [ m ] ) ) { if ( updateC ) { countC ++ ; updateC = false ; names . add ( newName ) ; } countM ++ ; } } if ( countM == members . size ( ) ) { splitFlag = false ; if ( members . size ( ) == newMembers . size ( ) ) { out . printf ( " did not change.%n" ) ; countNoChange ++ ; } else { out . printf ( " is contained in %s.%n" , newName ) ; countContained ++ ; } break ; } } if ( splitFlag ) { out . printf ( "split to %d clusters: %s%n" , countC , names ) ; } } out . printf ( "Summary:%n%d clusters did not change.%n%d clusters are contained.%n%d clusters split.%n" , countNoChange , countContained , m_initialClusters . size ( ) - countNoChange - countContained ) ; out . close ( ) ; }
write the initial clustering changes to a file .
