public ClusteringTreeModel(List <string> dataSet, List <string> parsedRegions, List <string> fileTextes, List <string> files)
        {
            int leafIndex = 0;

            nodeCollection = new ClusterNodeCollection();
            leafCollection = new ClusterLeafCollection();

            var hash = new HashSet <string>();

            foreach (string item in dataSet)
            {
                if (hash.Contains(item))
                {
                    leafIndex++;
                    continue;
                }
                hash.Add(item);

                var leaf = new ClusterLeaf
                {
                    Id       = leafIndex,
                    FileName = files[leafIndex],
                    FileText = fileTextes[leafIndex],
                    Region   = parsedRegions[leafIndex],
                    Value    = dataSet[leafIndex]
                };
                leafCollection.Add(leaf);
                leafIndex++;
            }
        }
Exemple #2
0
 public void Add(ClusterLeaf leaf)
 {
     leafs.Add(leaf);
 }
 public void Add(ClusterLeaf leaf)
 {
     leafCollection.Add(leaf);
 }