com.hardcode.gdbms.engine.instruction
Class SelectAdapter

java.lang.Object
  extended by com.hardcode.gdbms.engine.instruction.Adapter
      extended by com.hardcode.gdbms.engine.instruction.SelectAdapter

public class SelectAdapter
extends Adapter

Adapta el nodo que representa una instrucción select en el árbol sintáctico de entrada

Author:
Fernando González Cortés

Field Summary
static int ORDER_ASC
           
static int ORDER_DESC
           
static int ORDER_NONE
           
 
Constructor Summary
SelectAdapter()
           
 
Method Summary
 DataSource getDataSource()
          Obtiene el origen de datos para los campos a la hora de evaluar las expresiones
 java.lang.String getFieldName(int index)
          Gets the name of the order field in the index-th criterion.
 java.lang.String[] getFieldsAlias()
          Obtiene el alias de los campos.
 Expression[] getFieldsExpression()
          Obtiene las expresiones de los campos de la cláusula SELECT o null si hay un ''.
 int getOrder(int index)
          Gets a constant indicating ascendent or descendent for the index-th criterion.
 int getOrderCriterionCount()
          Gets the number of fields specified in the orderby clause or 0 if there is no such clause
 DataSource[] getTables()
          Obtiene las tablas de la cláusula FROM de la instrucción
 Expression getWhereExpression()
           
 boolean isDistinct()
          Devuelve true si la palabra clave DISTINCT se usó y false en caso contrario
 void setDataSource(DataSource source)
          Establece el origen de datos para los campos a la hora de evaluar las expresiones
 void setTables(DataSource[] tables)
           
 
Methods inherited from class com.hardcode.gdbms.engine.instruction.Adapter
getChilds, getEntity, getInstructionContext, getParent, replaceChild, setChilds, setEntity, setInstructionContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_ASC

public static final int ORDER_ASC
See Also:
Constant Field Values

ORDER_DESC

public static final int ORDER_DESC
See Also:
Constant Field Values

ORDER_NONE

public static final int ORDER_NONE
See Also:
Constant Field Values
Constructor Detail

SelectAdapter

public SelectAdapter()
Method Detail

getTables

public DataSource[] getTables()
                       throws com.hardcode.driverManager.DriverLoadException,
                              NoSuchTableException,
                              DataSourceCreationException
Obtiene las tablas de la cláusula FROM de la instrucción

Returns:
Tablas de la select
Throws:
SemanticException - Si se produce un error semántico
NoSuchTableException
CreationException
com.hardcode.driverManager.DriverLoadException
DriverException
DataSourceCreationException

getFieldsExpression

public Expression[] getFieldsExpression()
Obtiene las expresiones de los campos de la cláusula SELECT o null si hay un ''.

Returns:
Expresiones de los campos

getFieldsAlias

public java.lang.String[] getFieldsAlias()
Obtiene el alias de los campos. Al igual que getFieldsExpression, devuelve null si se selecciona ''

Returns:
Array de strings con los alias

isDistinct

public boolean isDistinct()
Devuelve true si la palabra clave DISTINCT se usó y false en caso contrario

Returns:
Devuelve true si se utilizó la palabra clave DISTINCT

getOrderCriterionCount

public int getOrderCriterionCount()
Gets the number of fields specified in the orderby clause or 0 if there is no such clause

Returns:
int

getFieldName

public java.lang.String getFieldName(int index)
Gets the name of the order field in the index-th criterion. Will return null if there is no orderby clause

Parameters:
index - index of the order criterion to be guessed
Returns:
int

getOrder

public int getOrder(int index)
Gets a constant indicating ascendent or descendent for the index-th criterion. Will return ORDER_NONE if there is no order by clause, ORDER_ASC if the index-th criterion is ascending and ORDER_DESC if the index-th criterion is descending

Parameters:
index - index of the order criterion to be guessed
Returns:
int

setTables

public void setTables(DataSource[] tables)
See Also:
com.hardcode.gdbms.engine.instruction.SelectInstruction#setTables(com.hardcode.gdbms.engine.data.DataSource[])

getDataSource

public DataSource getDataSource()
Obtiene el origen de datos para los campos a la hora de evaluar las expresiones

Returns:

setDataSource

public void setDataSource(DataSource source)
Establece el origen de datos para los campos a la hora de evaluar las expresiones

Parameters:
source -

getWhereExpression

public Expression getWhereExpression()
See Also:
com.hardcode.gdbms.engine.instruction.SelectInstruction#getWhereExpression()


Copyright © 2005-2006 . All Rights Reserved.