com.endeca.navigation.analytics
Class Select

java.lang.Object
  extended by com.endeca.navigation.analytics.Select
All Implemented Interfaces:
QueryNode

public class Select
extends Object
implements QueryNode

A Select operation represents the assignment of a named derived value to a record produced as the result of a Statement. The definition of the derived value is given by an expression.


Constructor Summary
Select(String field, Expr expr)
          Constructs a new Select which will associate the result of expr with the derived property named field.
 
Method Summary
 Expr getExpr()
          Gets the derived property expression for this Select.
 String getFieldName()
          Gets the name of the derived property that this Select should produce.
 void setExpr(Expr expr)
          Sets the derived property expression for this Select.
 void setFieldName(String name)
          Sets the name of the derived property that this Select should produce.
 String toString()
          Returns the string form of this Select.
 String toWire()
          Returns the wire format of this Select.
 void validateSyntax()
          Validates the syntax of this Select.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Select

public Select(String field,
              Expr expr)
Constructs a new Select which will associate the result of expr with the derived property named field.

Parameters:
field - the name of the derived property.
expr - an expression object of type Expr.
Method Detail

setFieldName

public void setFieldName(String name)
Sets the name of the derived property that this Select should produce.

Parameters:
name - the name of the derived property.

getFieldName

public String getFieldName()
Gets the name of the derived property that this Select should produce.

Returns:
The name of the derived property.

setExpr

public void setExpr(Expr expr)
Sets the derived property expression for this Select.

Parameters:
expr - an expression object of type Expr.

getExpr

public Expr getExpr()
Gets the derived property expression for this Select.

Returns:
The derived property expression as an object of type Expr.

toString

public String toString()
Returns the string form of this Select. These are of the format:
expression AS derived-prop-name
For example:
AVG(Amount) / MAX(Amount) AS AvgOverMax
is returned if the derived property name is "AvgOverMax" and the expression assigns the ratio of the average "Amount" value to the maximum "Amount" value.

Specified by:
toString in interface QueryNode
Overrides:
toString in class Object
Returns:
A string representation of this Select in the specified format.

toWire

public String toWire()
Returns the wire format of this Select. This method is not intended for public use because the wire format is subject to change.

Specified by:
toWire in interface QueryNode
Returns:
A wire format representation of this Select.

validateSyntax

public void validateSyntax()
                    throws SyntaxException
Validates the syntax of this Select. A Select is valid if the derived property name is non-null and non-empty and the expression is itself valid.

Specified by:
validateSyntax in interface QueryNode
Throws:
SyntaxException - if the syntax requirements are not satisfied.


2010 Endeca Technologies, Inc.
Endeca Confidential