com.akiban.sql.parser
Class ResultColumnList

java.lang.Object
  extended by com.akiban.sql.parser.QueryTreeNode
      extended by com.akiban.sql.parser.QueryTreeNodeList<ResultColumn>
          extended by com.akiban.sql.parser.ResultColumnList
All Implemented Interfaces:
Visitable, Iterable<ResultColumn>

public class ResultColumnList
extends QueryTreeNodeList<ResultColumn>

A ResultColumnList is the target list of a SELECT, INSERT, or UPDATE.

See Also:
ResultColumn

Field Summary
protected  boolean forUpdate
           
 
Fields inherited from class com.akiban.sql.parser.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
 
Constructor Summary
ResultColumnList()
           
 
Method Summary
 void addResultColumn(ResultColumn resultColumn)
          Add a ResultColumn (at this point, ResultColumn or AllResultColumn) to the list
 void appendResultColumns(ResultColumnList resultColumns, boolean destructiveCopy)
          Append a given ResultColumnList to this one, resetting the virtual column ids in the appended portion.
 String[] getColumnNames()
          Get an array of strings for all the columns in this RCL.
 ResultColumnList getJoinColumns(ResultColumnList joinColumns)
          Get the join columns from this list.
 ResultColumn getOrderByColumn(int position)
          Get a ResultColumn from a column position (1-based) in the list, null if out of range (for order by).
 ResultColumn getResultColumn(int position)
          Get a ResultColumn from a column position (1-based) in the list
 ResultColumn getResultColumn(String columnName)
          Get a ResultColumn that matches the specified columnName.
protected  void markInitialSize()
           
 void removeJoinColumns(ResultColumnList joinColumns)
          Remove the columns which are join columns (in the joinColumns RCL) from this list.
 String toString()
          Convert this object to a String.
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNodeList
add, add, addAll, clear, copyFrom, destructiveAddAll, get, getList, indexOf, isEmpty, iterator, printSubNodes, remove, remove, set, size
 
Methods inherited from class com.akiban.sql.parser.QueryTreeNode
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

forUpdate

protected boolean forUpdate
Constructor Detail

ResultColumnList

public ResultColumnList()
Method Detail

addResultColumn

public void addResultColumn(ResultColumn resultColumn)
Add a ResultColumn (at this point, ResultColumn or AllResultColumn) to the list

Parameters:
resultColumn - The ResultColumn to add to the list

appendResultColumns

public void appendResultColumns(ResultColumnList resultColumns,
                                boolean destructiveCopy)
Append a given ResultColumnList to this one, resetting the virtual column ids in the appended portion.

Parameters:
resultColumns - The ResultColumnList to be appended
destructiveCopy - Whether or not this is a destructive copy from resultColumns

getResultColumn

public ResultColumn getResultColumn(int position)
Get a ResultColumn from a column position (1-based) in the list

Parameters:
position - The ResultColumn to get from the list (1-based)
Returns:
the column at that position.

getOrderByColumn

public ResultColumn getOrderByColumn(int position)
Get a ResultColumn from a column position (1-based) in the list, null if out of range (for order by).

Parameters:
position - The ResultColumn to get from the list (1-based)
Returns:
the column at that position, null if out of range

getResultColumn

public ResultColumn getResultColumn(String columnName)
Get a ResultColumn that matches the specified columnName. If requested to, mark the column as referenced.

Parameters:
columnName - The ResultColumn to get from the list
markIfReferenced - True if we should mark this column as referenced.
Returns:
the column that matches that name.

getColumnNames

public String[] getColumnNames()
Get an array of strings for all the columns in this RCL.

Returns:
the array of strings

removeJoinColumns

public void removeJoinColumns(ResultColumnList joinColumns)
Remove the columns which are join columns (in the joinColumns RCL) from this list. This is useful for a JOIN with a USING clause.

Parameters:
joinColumns - The list of join columns

getJoinColumns

public ResultColumnList getJoinColumns(ResultColumnList joinColumns)
                                throws StandardException
Get the join columns from this list. This is useful for a join with a USING clause. (ANSI specifies that the join columns appear 1st.)

Parameters:
joinColumns - A list of the join columns.
Returns:
A list of the join columns from this list
Throws:
StandardException

markInitialSize

protected void markInitialSize()

toString

public String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class QueryTreeNode
Returns:
This object as a String


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.