示例#1
0
        public object Clone()
        {
            IClustersList TargetClustersList = new IClustersList();

            foreach (ICluster cluster in m_ClustersList)
            {
                IItemsList TargetCentroidsList = new IItemsList();
                foreach (Item centroid in (IItemsList)cluster.Centroids.Clone())
                {
                    TargetCentroidsList.Add(new Item(centroid.ItemText, (IAttribList)centroid.AttribList.Clone(),
                                                     centroid.Distance, centroid.IsUser, centroid.Exists));
                }

                IItemsList TargetItemsList = new IItemsList();
                foreach (Item item in (IItemsList)cluster.Items.Clone())
                {
                    TargetItemsList.Add(new Item(item.ItemText, (IAttribList)item.AttribList.Clone(),
                                                 item.Distance, item.IsUser, item.Exists));
                }

                TargetClustersList.Add(new ICluster((IItemsList)TargetCentroidsList.Clone(),
                                                    (IItemsList)TargetItemsList.Clone()));
            }

            return(TargetClustersList);
        }