public final void updateClusters(List<ClusterData> clusterData,int[] matIndexToMsgInternalId){
  final Map<String,Collection<Integer>> names=new HashMap<String,Collection<Integer>>();
  int count=0;
  String cName=null;
  m_finalClusterNames=new HashMap<Integer,String>();
  for (int i=0; i < clusterData.size(); ++i) {
    final ClusterData cd=clusterData.get(i);
    final Collection<Integer> c=cd.m_cluster;
    if (cd.m_clusterUsage == AbstractClusteringScorer.ClusterUsage.USED) {
      if (m_initialClusters == null) {
        cName="CLUSTER_" + count++;
        names.put(cName,c);
      }
 else {
        final ClusterMeasures cM=findClusterName(c,matIndexToMsgInternalId);
        if (cM.m_name == null) {
          cM.m_name=findNewName(names);
          names.put(cM.m_name,c);
          updateClusteringDetails(null,null,cM,c,matIndexToMsgInternalId);
        }
 else {
          if (names.containsKey(cM.m_name)) {
            cM.m_name=solveDuplicatedNames(cName,names);
          }
          names.put(cM.m_name,c);
          updateClusteringDetails(cM.m_name,m_initialClusters.get(cM.m_name),cM,c,matIndexToMsgInternalId);
        }
      }
      final ClusterMeasures cM=findClusterName(c,matIndexToMsgInternalId);
      m_finalClusterNames.put(cd.m_id,cM.m_name);
    }
  }
  m_finalClusters=(HashMap<String,Collection<Integer>>)names;
}

public final void updateClusters ( List < ClusterData > clusterData , int [ ] matIndexToMsgInternalId ) { final Map < String , Collection < Integer > > names = new HashMap < String , Collection < Integer > > ( ) ; int count = 0 ; String cName = null ; m_finalClusterNames = new HashMap < Integer , String > ( ) ; for ( int i = 0 ; i < clusterData . size ( ) ; ++ i ) { final ClusterData cd = clusterData . get ( i ) ; final Collection < Integer > c = cd . m_cluster ; if ( cd . m_clusterUsage == AbstractClusteringScorer . ClusterUsage . USED ) { if ( m_initialClusters == null ) { cName = "CLUSTER_" + count ++ ; names . put ( cName , c ) ; } else { final ClusterMeasures cM = findClusterName ( c , matIndexToMsgInternalId ) ; if ( cM . m_name == null ) { cM . m_name = findNewName ( names ) ; names . put ( cM . m_name , c ) ; updateClusteringDetails ( null , null , cM , c , matIndexToMsgInternalId ) ; } else { if ( names . containsKey ( cM . m_name ) ) { cM . m_name = solveDuplicatedNames ( cName , names ) ; } names . put ( cM . m_name , c ) ; updateClusteringDetails ( cM . m_name , m_initialClusters . get ( cM . m_name ) , cM , c , matIndexToMsgInternalId ) ; } } final ClusterMeasures cM = findClusterName ( c , matIndexToMsgInternalId ) ; m_finalClusterNames . put ( cd . m_id , cM . m_name ) ; } } m_finalClusters = ( HashMap < String , Collection < Integer > > ) names ; }
update the clusters using the passed in cluster data .
