public ResultColumn(ResultSet resultSet, TParseTreeNode columnObject) { if (columnObject == null || resultSet == null) { throw new System.ArgumentException("ResultColumn arguments can't be null."); } id = ++TableColumn.TABLE_COLUMN_ID; this.resultSet = resultSet; resultSet.addColumn(this); this.columnObject = columnObject; TSourceToken startToken = columnObject.startToken; TSourceToken endToken = columnObject.endToken; if (columnObject is TObjectName) { if (((TObjectName)columnObject).ColumnNameOnly != null && !"".Equals(((TObjectName)columnObject).ColumnNameOnly)) { this.name = ((TObjectName)columnObject).ColumnNameOnly; } else { this.name = ((TObjectName)columnObject).ToString(); } } else { this.name = columnObject.ToString(); } this.fullName = columnObject.ToString(); this.startPosition = new Tuple <long, long>(startToken.lineNo, startToken.columnNo); this.endPosition = new Tuple <long, long>(endToken.lineNo, endToken.columnNo + endToken.astext.Length); }
public ResultColumn(SelectResultSet resultSet, Tuple <TResultColumn, TObjectName> starColumnPair) { if (starColumnPair == null || resultSet == null) { throw new System.ArgumentException("ResultColumn arguments can't be null."); } id = ++TableColumn.TABLE_COLUMN_ID; this.resultSet = resultSet; resultSet.addColumn(this); this.columnObject = starColumnPair.Item1; TSourceToken startToken = columnObject.startToken; TSourceToken endToken = columnObject.endToken; this.name = ((TObjectName)columnObject).ColumnNameOnly; this.fullName = columnObject.ToString(); this.startPosition = new Tuple <long, long>(startToken.lineNo, startToken.columnNo); this.endPosition = new Tuple <long, long>(endToken.lineNo, endToken.columnNo + endToken.astext.Length); }