⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 marketbasedanalysisdatabase.cs

📁 一个经典的apriori算法(c#实现)
💻 CS
📖 第 1 页 / 共 4 页
字号:
                }
            }
            
            public int SubsetID {
                get {
                    return ((int)(this[this.tableSubsetTable.SubsetIDColumn]));
                }
                set {
                    this[this.tableSubsetTable.SubsetIDColumn] = value;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class SubsetTableRowChangeEvent : EventArgs {
            
            private SubsetTableRow eventRow;
            
            private DataRowAction eventAction;
            
            public SubsetTableRowChangeEvent(SubsetTableRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public SubsetTableRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class RulesTableDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnFirstKeyID;
            
            private DataColumn columnLeftRule;
            
            private DataColumn columnRightRule;
            
            private DataColumn columnConfidence;
            
            internal RulesTableDataTable() : 
                    base("RulesTable") {
                this.InitClass();
            }
            
            internal RulesTableDataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
                this.DisplayExpression = table.DisplayExpression;
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            internal DataColumn FirstKeyIDColumn {
                get {
                    return this.columnFirstKeyID;
                }
            }
            
            internal DataColumn LeftRuleColumn {
                get {
                    return this.columnLeftRule;
                }
            }
            
            internal DataColumn RightRuleColumn {
                get {
                    return this.columnRightRule;
                }
            }
            
            internal DataColumn ConfidenceColumn {
                get {
                    return this.columnConfidence;
                }
            }
            
            public RulesTableRow this[int index] {
                get {
                    return ((RulesTableRow)(this.Rows[index]));
                }
            }
            
            public event RulesTableRowChangeEventHandler RulesTableRowChanged;
            
            public event RulesTableRowChangeEventHandler RulesTableRowChanging;
            
            public event RulesTableRowChangeEventHandler RulesTableRowDeleted;
            
            public event RulesTableRowChangeEventHandler RulesTableRowDeleting;
            
            public void AddRulesTableRow(RulesTableRow row) {
                this.Rows.Add(row);
            }
            
            public RulesTableRow AddRulesTableRow(int LeftRule, int RightRule, System.Double Confidence) {
                RulesTableRow rowRulesTableRow = ((RulesTableRow)(this.NewRow()));
                rowRulesTableRow.ItemArray = new object[] {
                        null,
                        LeftRule,
                        RightRule,
                        Confidence};
                this.Rows.Add(rowRulesTableRow);
                return rowRulesTableRow;
            }
            
            public RulesTableRow FindByFirstKeyID(int FirstKeyID) {
                return ((RulesTableRow)(this.Rows.Find(new object[] {
                            FirstKeyID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                RulesTableDataTable cln = ((RulesTableDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new RulesTableDataTable();
            }
            
            internal void InitVars() {
                this.columnFirstKeyID = this.Columns["FirstKeyID"];
                this.columnLeftRule = this.Columns["LeftRule"];
                this.columnRightRule = this.Columns["RightRule"];
                this.columnConfidence = this.Columns["Confidence"];
            }
            
            private void InitClass() {
                this.columnFirstKeyID = new DataColumn("FirstKeyID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnFirstKeyID);
                this.columnLeftRule = new DataColumn("LeftRule", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnLeftRule);
                this.columnRightRule = new DataColumn("RightRule", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnRightRule);
                this.columnConfidence = new DataColumn("Confidence", typeof(System.Double), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnConfidence);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnFirstKeyID}, true));
                this.columnFirstKeyID.AutoIncrement = true;
                this.columnFirstKeyID.AutoIncrementSeed = 1;
                this.columnFirstKeyID.AllowDBNull = false;
                this.columnFirstKeyID.Unique = true;
            }
            
            public RulesTableRow NewRulesTableRow() {
                return ((RulesTableRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new RulesTableRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(RulesTableRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.RulesTableRowChanged != null)) {
                    this.RulesTableRowChanged(this, new RulesTableRowChangeEvent(((RulesTableRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.RulesTableRowChanging != null)) {
                    this.RulesTableRowChanging(this, new RulesTableRowChangeEvent(((RulesTableRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.RulesTableRowDeleted != null)) {
                    this.RulesTableRowDeleted(this, new RulesTableRowChangeEvent(((RulesTableRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.RulesTableRowDeleting != null)) {
                    this.RulesTableRowDeleting(this, new RulesTableRowChangeEvent(((RulesTableRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveRulesTableRow(RulesTableRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class RulesTableRow : DataRow {
            
            private RulesTableDataTable tableRulesTable;
            
            internal RulesTableRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableRulesTable = ((RulesTableDataTable)(this.Table));
            }
            
            public int FirstKeyID {
                get {
                    return ((int)(this[this.tableRulesTable.FirstKeyIDColumn]));
                }
                set {
                    this[this.tableRulesTable.FirstKeyIDColumn] = value;
                }
            }
            
            public int LeftRule {
                get {
                    try {
                        return ((int)(this[this.tableRulesTable.LeftRuleColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableRulesTable.LeftRuleColumn] = value;
                }
            }
            
            public int RightRule {
                get {
                    try {
                        return ((int)(this[this.tableRulesTable.RightRuleColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableRulesTable.RightRuleColumn] = value;
                }
            }
            
            public System.Double Confidence {
                get {
                    try {
                        return ((System.Double)(this[this.tableRulesTable.ConfidenceColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableRulesTable.ConfidenceColumn] = value;
                }
            }
            
            public bool IsLeftRuleNull() {
                return this.IsNull(this.tableRulesTable.LeftRuleColumn);
            }
            
            public void SetLeftRuleNull() {
                this[this.tableRulesTable.LeftRuleColumn] = System.Convert.DBNull;
            }
            
            public bool IsRightRuleNull() {
                return this.IsNull(this.tableRulesTable.RightRuleColumn);
            }
            
            public void SetRightRuleNull() {
                this[this.tableRulesTable.RightRuleColumn] = System.Convert.DBNull;
            }
            
            public bool IsConfidenceNull() {
                return this.IsNull(this.tableRulesTable.ConfidenceColumn);
            }
            
            public void SetConfidenceNull() {
                this[this.tableRulesTable.ConfidenceColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class RulesTableRowChangeEvent : EventArgs {
            
            private RulesTableRow eventRow;
            
            private DataRowAction eventAction;
            
            public RulesTableRowChangeEvent(RulesTableRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public RulesTableRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -