|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.navigation.analytics.ExprFunction
public class ExprFunction
ExprFunction
instances represent unary scalar
function expressions.
Nested Class Summary | |
---|---|
static class |
ExprFunction.ExprFunctionOp
Enumeration of Endeca unary scalar functions. |
Field Summary | |
---|---|
static ExprFunction.ExprFunctionOp |
ABS
Absolute value function. |
static ExprFunction.ExprFunctionOp |
CEIL
Ceiling function. |
static ExprFunction.ExprFunctionOp |
COS
Cosine function. |
static int |
DATE
Date constant. |
static int |
DAY_OF_MONTH
Day-of-month constant. |
static int |
DAY_OF_WEEK
Day-of-week constant. |
static int |
DAY_OF_YEAR
Day-of-year constant. |
static ExprFunction.ExprFunctionOp |
EXP
Exponential function. |
static ExprFunction.ExprFunctionOp |
EXTRACT
Date Extraction function. |
static ExprFunction.ExprFunctionOp |
FLOOR
Floor function. |
static int |
HOUR
Hour constant. |
static ExprFunction.ExprFunctionOp |
LAG
Lag function. |
static ExprFunction.ExprFunctionOp |
LEAD
Lead function. |
static ExprFunction.ExprFunctionOp |
LN
Natural logarithm function. |
static int |
MINUTE
Minute constant. |
static int |
MONTH
Month constant. |
static int |
QUARTER
Quarter year constant. |
static ExprFunction.ExprFunctionOp |
ROUND
Round function. |
static int |
SECOND
Second constant. |
static ExprFunction.ExprFunctionOp |
SIGN
Sign function. |
static ExprFunction.ExprFunctionOp |
SIN
Sine function. |
static ExprFunction.ExprFunctionOp |
SQRT
Square root function. |
static ExprFunction.ExprFunctionOp |
TAN
Tangent function. |
static ExprFunction.ExprFunctionOp |
TO_DURATION
Duration function. |
static ExprFunction.ExprFunctionOp |
TRUNC
Date Truncation function. |
static int |
WEEK
Week constant. |
static int |
YEAR
Year constant. |
Constructor Summary | |
---|---|
ExprFunction(ExprFunction.ExprFunctionOp func,
Expr subExpr,
int param)
Creates a new ExprFunction of the specified
subexpression subExpr . |
Method Summary | |
---|---|
Expr |
getExpr()
Gets the subexpression for this ExprFunction . |
void |
setExpr(Expr expr)
Sets the subexpression for this ExprFunction . |
ExprFunction.ExprFunctionOp |
setFunction()
Gets the mathematical function for this ExprFunction . |
void |
setFunction(ExprFunction.ExprFunctionOp function)
Sets the function for this ExprFunction . |
String |
toString()
Returns the string form of this ExprFunction . |
String |
toWire()
Returns the wire form of this ExprFunction . |
void |
validateSyntax()
Validates the syntax of this ExprFunction . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ExprFunction.ExprFunctionOp ABS
public static final ExprFunction.ExprFunctionOp CEIL
public static final ExprFunction.ExprFunctionOp COS
public static final ExprFunction.ExprFunctionOp EXP
public static final ExprFunction.ExprFunctionOp EXTRACT
param
parameter of the constructor. See the
"Constant Field Values" page for the constants
that map to the extracted portion (such as 8 for
the month).
public static final ExprFunction.ExprFunctionOp FLOOR
public static final ExprFunction.ExprFunctionOp LAG
param
parameter of the constructor.
public static final ExprFunction.ExprFunctionOp LEAD
param
parameter of the constructor.
public static final ExprFunction.ExprFunctionOp LN
public static final ExprFunction.ExprFunctionOp ROUND
public static final ExprFunction.ExprFunctionOp SIGN
public static final ExprFunction.ExprFunctionOp SIN
public static final ExprFunction.ExprFunctionOp SQRT
public static final ExprFunction.ExprFunctionOp TAN
public static final ExprFunction.ExprFunctionOp TO_DURATION
public static final ExprFunction.ExprFunctionOp TRUNC
param
parameter of the constructor. See the
"Constant Field Values" page for the constants
that map to the truncated portion (such as 8 for
the month).
public static final int SECOND
EXTRACT
and TRUNC
functions.
public static final int MINUTE
EXTRACT
and TRUNC
functions.
public static final int HOUR
EXTRACT
and TRUNC
functions.
public static final int DAY_OF_WEEK
EXTRACT
and TRUNC
functions.
public static final int DAY_OF_MONTH
EXTRACT
and TRUNC
functions.
public static final int DAY_OF_YEAR
EXTRACT
and TRUNC
functions.
public static final int DATE
EXTRACT
and
TRUNC
functions.
public static final int WEEK
EXTRACT
and TRUNC
functions.
public static final int MONTH
EXTRACT
and TRUNC
functions.
public static final int QUARTER
EXTRACT
and TRUNC
functions.
public static final int YEAR
EXTRACT
and TRUNC
functions.
Constructor Detail |
---|
public ExprFunction(ExprFunction.ExprFunctionOp func, Expr subExpr, int param)
ExprFunction
of the specified
subexpression subExpr
.
func
- a function of type ExprFunction.ExprFunctionOp
that specifies the type of operation to be made. See the
setFunction
method for a list of the
function names.subExpr
- a subexpression of type Expr
. If
func
is LAG or LEAD, then subExpr
must be an ExprKey
.param
- an integer to be used only with the EXTRACT, LAG,
LEAD, ROUND, and TRUNC functions. For ROUND and TRUNC,
positive numbers round to the equivalent number of
decimal places; negative numbers round to the equivalent place to
the left of the decimal place. For TRUNC (when subExpr
is a date/time) and EXTRACT, param
is
a constant such as HOUR
or YEAR
.Method Detail |
---|
public void setFunction(ExprFunction.ExprFunctionOp function)
ExprFunction
.
function
- a function of type ExprFunction.ExprFunctionOp
that specifies the type of operation to be made.
The functions are: ExprFunction.ABS
,
ExprFunction.CEIL
, ExprFunction.COS
,
ExprFunction.EXP
, ExprFunction.EXTRACT
,
ExprFunction.FLOOR
, ExprFunction.LAG
,
ExprFunction.LEAD
, ExprFunction.LN
,
ExprFunction.ROUND
, ExprFunction.SIGN
,
ExprFunction.SIN
, ExprFunction.SQRT
,
ExprFunction.TAN
, ExprFunction.TO_DURATION
,
and ExprFunction.TRUNC
.public ExprFunction.ExprFunctionOp setFunction()
ExprFunction
.
ExprFunction.ExprFunctionOp
)
for this ExprFunction
.
See the setFunction
method for a list of the
function names.public void setExpr(Expr expr)
ExprFunction
.
expr
- an expression of type Expr
.public Expr getExpr()
ExprFunction
.
Expr
)
for this ExprFunction
.public String toString()
ExprFunction
. The format
for the EXTRACT, LAG, LEAD, ROUND, and TRUNC functions is:
FUNCTION(subexpression), paramwhere FUNCTION is a function name and param is a value set by the
param
parameter to the constructor.
The format for the other functions omits the param setting.
toString
in interface QueryNode
toString
in class Object
ExprFunction
in the specified format.public String toWire()
ExprFunction
. This method is not
intended for public use because the wire format is subject to change.
toWire
in interface QueryNode
ExprFunction
.public void validateSyntax() throws SyntaxException
ExprFunction
.
An ExprFunction
is valid if the function is
not null and the subexpression is non-null and valid.
validateSyntax
in interface QueryNode
SyntaxException
- if the syntax requirements are not satisfied.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |