private CL getFromClusterMap ( int clusterId , Map < Integer , CL > clusterMap ) { CL c = clusterMap . get ( clusterId ) ; if ( c . getFeatureIds ( ) == null ) { c . setFeatureIds ( knowledgeBase . getModelParameters ( ) . getFeatureIds ( ) ) ; //fetch the featureIds from model parameters object } return c ; }
Always use this method to get the cluster from the clusterMap because it ensures that the featureIds are set . The featureIds can be unset if we use a data structure which stores stuff in file . Since the featureIds field of cluster is transient the information gets lost . This function ensures that it sets it back .