Example #1
0
        public columnMap <T> CloneDefaultMap()
        {
            columnMap <T> output = new columnMap <T>();

            foreach (var pair in defaultMap)
            {
                output.Add(pair.Key, pair.Value);
            }
            Add(output);
            return(output);
        }
Example #2
0
        public columnMapSet()
        {
            if (typeof(T).IsEnum)
            {
                // creates default map
                var n = Enum.GetNames(typeof(T)).ToList();
                var v = Enum.GetValues(typeof(T));

                defaultMap = new columnMap <T>();
                foreach (T e in v)
                {
                    defaultMap.Add(e, e.ToString());
                }
                this.Add(defaultMap);
            }
        }
Example #3
0
        /// <summary>
        /// Returns column map having the highest crosssection with given column labels
        /// </summary>
        /// <param name="columnLabels">The column labels.</param>
        /// <returns></returns>
        public columnMap <T> RecognizeSet(List <String> columnLabels)
        {
            Int32 maxScore = Int32.MinValue;

            columnMap <T> output = null;

            foreach (columnMap <T> map in this)
            {
                var mapLabels = map.Values.ToList();

                Int32 c = mapLabels.GetCrossSection(columnLabels).Count;
                if (maxScore < c)
                {
                    output   = map;
                    maxScore = c;
                }
            }

            return(output);
        }