com.endeca.navigation.analytics
Class ExprConstant

java.lang.Object
  extended by com.endeca.navigation.analytics.ExprConstant
All Implemented Interfaces:
Expr, QueryNode

public class ExprConstant
extends Object
implements Expr

Instances of ExprConstant represent constants. Constants are used in expressions, such as the "2" in "x + 2". Both string and numeric constants are treated identically.


Constructor Summary
ExprConstant(String value)
          Creates a new ExprConstant expression node representing the specified constant value.
 
Method Summary
 String getValue()
          Gets the constant value for this ExprConstant.
 void setValue(String value)
          Sets the value for the constant represented by this ExprConstant.
 String toString()
          Returns the string form of this ExprConstant.
 String toWire()
          Returns the wire form of this ExprConstant.
 void validateSyntax()
          Validates the syntax of this ExprConstant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExprConstant

public ExprConstant(String value)
Creates a new ExprConstant expression node representing the specified constant value.

Parameters:
value - the constant to be used in an expression.
Method Detail

getValue

public String getValue()
Gets the constant value for this ExprConstant.

Returns:
The constant as a String.

setValue

public void setValue(String value)
Sets the value for the constant represented by this ExprConstant.

Parameters:
value - the constant to be used in an expression.

toString

public String toString()
Returns the string form of this ExprConstant. These are of the format: 'john' or '3' or '56.903'.

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

toWire

public String toWire()
Returns the wire form of this ExprConstant. 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 ExprConstant.

validateSyntax

public void validateSyntax()
                    throws SyntaxException
Validates the syntax of this ExprConstant. An ExprConstant is valid if the String representing the value is non-null and non-empty. Note that the String should represent a numeric value, but this is not enforced during validation.

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


© 2011 Endeca Technologies, Inc.
Endeca Confidential