コード例 #1
0
        public override StringTable GetTable()
        {
            StringTable toreturn = SavedTable.GetTable();

            toreturn.RemoveColumn(NameColumn);
            return(toreturn);
        }
コード例 #2
0
        public override StringTable GetTable()
        {
            StringTable   temp          = SavedTable.GetTable();
            List <string> columntocount = temp.GetColumn(NameColumn);
            StringTable   newtable      = new StringTable();

            newtable.NewColumn(NameColumn);
            newtable.NewColumn("Amount");
            List <string> uniquellabels = new List <string>();
            List <int>    amounts       = new List <int>();

            for (int i = 0; i < columntocount.Count; i++)
            {
                if (uniquellabels.Contains(columntocount[i]))
                {
                    amounts[uniquellabels.IndexOf(columntocount[i])] += 1;
                }
                else
                {
                    uniquellabels.Add(columntocount[i]);
                    amounts.Add(1);
                }
            }
            foreach (string i in uniquellabels)
            {
                newtable.AddValueToColumn(NameColumn, i);
            }
            foreach (int i in amounts)
            {
                newtable.AddValueToColumn("Amount", i.ToString());
            }

            return(newtable);
        }
コード例 #3
0
ファイル: FilterOut.cs プロジェクト: ChavaDekker/Project4
        public override StringTable GetTable()
        {
            StringTable   temp     = SavedTable.GetTable();
            List <String> Column   = temp.GetColumn(NameColumn);
            List <int>    Toremove = new List <int>();

            for (int i = 0; i < Column.Count; i++)
            {
                if (Column[i] == FieldContent)
                {
                    Toremove.Add(i);
                }
            }
            int amountofitems = Column.Count - 1;

            for (int i = amountofitems; i >= 0; i--)
            {
                Column.RemoveAt(Toremove[i]);
            }
            return(temp);
        }