using System; namespace BCG { /// /// Resprsents information about a column schema, ie its ordinal, the type, the name and constant value or expression. where applicable /// [Serializable] public class ColumnInfo : IComparable { //the default column info does not cach values in a lookup table, therefore it is in group 0 public ColumnInfo(string colName, int colNo, Type colType) { myColName = colName; myColNo = colNo; myColType = colType; } public ColumnInfo(string col_name, int col_no, TypeCode type_code) : this(col_name, col_no, BlueDataUtility.get_type(type_code)) { } public int CompareTo(object obj) { int otherColNo = ((ColumnInfo)(obj)).colNo; if (myColNo < otherColNo) return -1; else if (myColNo > otherColNo) return 1; return 0; } public override bool Equals(object obj) { if (obj is ColumnInfo) { ColumnInfo other = obj as ColumnInfo; return (colNo == other.colNo) && (colName == other.colName) && (colType == other.colType); } return false; } public override string ToString() { return colName + " " + colNo + " " + colType; } // for backwards compatibility to allow build public bool isConstant { get { return false; } } private int myColNo; private string myColName; private Type myColType; public int colNo { get { return myColNo; } } public string colName { get { return myColName; } } public Type colType { get { return myColType; } } } }