public class Function extends Expression implements FunctionCall
Modifier and Type | Field and Description |
---|---|
static int |
ABS |
static int |
ACOS |
protected Expression[] |
args |
static int |
ARRAY_GET |
static int |
ARRAY_LENGTH |
static int |
ASCII |
static int |
ASIN |
static int |
ATAN |
static int |
ATAN2 |
static int |
AUTOCOMMIT |
static int |
BIT_LENGTH |
static int |
BITAND |
static int |
BITOR |
static int |
BITXOR |
static int |
CANCEL_SESSION |
static int |
CASE |
static int |
CASEWHEN |
static int |
CAST |
static int |
CEILING |
static int |
CHAR |
static int |
CHAR_LENGTH |
static int |
COALESCE |
static int |
COMPRESS |
static int |
CONCAT |
static int |
CONVERT |
static int |
COS |
static int |
COSH |
static int |
COT |
static int |
CSVREAD |
static int |
CSVWRITE |
static int |
CURDATE |
static int |
CURRENT_DATE |
static int |
CURRENT_TIME |
static int |
CURRENT_TIMESTAMP |
static int |
CURRENT_USER |
static int |
CURRVAL |
static int |
CURTIME |
static int |
DATABASE |
static int |
DATABASE_PATH |
static int |
DATE_ADD |
static int |
DATE_DIFF |
static int |
DAY_NAME |
static int |
DAY_OF_MONTH |
static int |
DAY_OF_WEEK |
static int |
DAY_OF_YEAR |
static int |
DECRYPT |
static int |
DEGREES |
static int |
DIFFERENCE |
static int |
ENCRYPT |
static int |
EXP |
static int |
EXPAND |
static int |
EXTRACT |
static int |
FILE_READ |
static int |
FLOOR |
static int |
FORMATDATETIME |
static int |
GREATEST |
static int |
HASH |
static int |
HEXTORAW |
static int |
HOUR |
static int |
IDENTITY |
static int |
IFNULL |
static int |
INSERT |
static int |
INSTR |
static int |
ISO_DAY_OF_WEEK |
static int |
ISO_WEEK |
static int |
ISO_YEAR |
static int |
LCASE |
static int |
LEAST |
static int |
LEFT |
static int |
LENGTH |
static int |
LINK_SCHEMA |
static int |
LOCATE |
static int |
LOCK_MODE |
static int |
LOCK_TIMEOUT |
static int |
LOG |
static int |
LOG10 |
static int |
LOWER |
static int |
LPAD |
static int |
LTRIM |
static int |
MEMORY_FREE |
static int |
MEMORY_USED |
static int |
MINUTE |
static int |
MOD |
static int |
MONTH |
static int |
MONTH_NAME |
static int |
NEXTVAL |
static int |
NOW |
static int |
NULLIF |
static int |
NVL2 |
static int |
OCTET_LENGTH |
static int |
PARSEDATETIME |
static int |
PI |
static int |
POSITION |
static int |
POWER |
static int |
QUARTER |
static int |
RADIANS |
static int |
RAND |
static int |
RANDOM_UUID |
static int |
RAWTOHEX |
static int |
READONLY |
static int |
REGEXP_REPLACE |
static int |
REPEAT |
static int |
REPLACE |
static int |
RIGHT |
static int |
ROUND |
static int |
ROUNDMAGIC |
static int |
ROW_NUMBER |
static int |
RPAD |
static int |
RTRIM |
static int |
SCHEMA |
static int |
SCOPE_IDENTITY |
static int |
SECOND |
static int |
SECURE_RAND |
static int |
SESSION_ID |
static int |
SET |
static int |
SIGN |
static int |
SIN |
static int |
SINH |
static int |
SOUNDEX |
static int |
SPACE |
static int |
SQRT |
static int |
STRINGDECODE |
static int |
STRINGENCODE |
static int |
STRINGTOUTF8 |
static int |
SUBSTR |
static int |
SUBSTRING |
static int |
TABLE |
static int |
TABLE_DISTINCT |
static int |
TAN |
static int |
TANH |
static int |
TRANSACTION_ID |
static int |
TRIM |
static int |
TRUNCATE |
static int |
TRUNCATE_VALUE |
static int |
UCASE |
static int |
UPPER |
static int |
USER |
static int |
UTF8TOSTRING |
static int |
WEEK |
static int |
XMLATTR |
static int |
XMLCDATA |
static int |
XMLCOMMENT |
static int |
XMLNODE |
static int |
XMLSTARTDOC |
static int |
XMLTEXT |
static int |
YEAR |
static int |
ZERO |
Modifier | Constructor and Description |
---|---|
protected |
Function(Database database,
org.h2.expression.FunctionInfo info) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkParameterCount(int len)
Check if the parameter count is correct.
|
void |
doneWithParameters()
This method is called after all the parameters have been set.
|
Expression[] |
getArgs()
Get the function arguments.
|
int |
getCost()
Estimate the cost to process the expression.
|
int |
getDisplaySize()
Get the display size of this expression.
|
static Function |
getFunction(Database database,
String name)
Get an instance of the given function for this database.
|
int |
getFunctionType() |
String |
getName()
Get the name of the function.
|
int |
getParameterCount()
Get the number of parameters.
|
long |
getPrecision()
Get the precision of this expression.
|
int |
getScale()
Get the scale of this expression.
|
String |
getSQL()
Get the SQL statement of this expression.
|
int |
getType()
Return the data type.
|
Value |
getValue(Session session)
Return the resulting value for the current row.
|
ValueResultSet |
getValueForColumnList(Session session,
Expression[] argList)
Get an empty result set with the column names set.
|
static boolean |
isDatePart(String part)
Check if a given string is a valid date part string.
|
boolean |
isDeterministic()
Whether the function always returns the same result for the same parameters.
|
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
boolean |
isFast()
Whether the function is fast, meaning the result shouldn't be cached.
|
void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns of the resolver to expression columns.
|
Expression |
optimize(Session session)
Try to optimize the expression.
|
void |
setDataType(Column col) |
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Tell the expression columns whether the table filter can return values now.
|
void |
setParameter(int index,
Expression param)
Set the parameter expression at the given index.
|
void |
updateAggregate(Session session)
Update an aggregate value.
|
addFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getExpressionColumns, getExpressionColumns, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getTableAlias, getTableName, isAutoIncrement, isConstant, isValueSet, isWildcard, toString
public static final int ABS
public static final int ACOS
public static final int ASIN
public static final int ATAN
public static final int ATAN2
public static final int BITAND
public static final int BITOR
public static final int BITXOR
public static final int CEILING
public static final int COS
public static final int COT
public static final int DEGREES
public static final int EXP
public static final int FLOOR
public static final int LOG
public static final int LOG10
public static final int MOD
public static final int PI
public static final int POWER
public static final int RADIANS
public static final int RAND
public static final int ROUND
public static final int ROUNDMAGIC
public static final int SIGN
public static final int SIN
public static final int SQRT
public static final int TAN
public static final int TRUNCATE
public static final int SECURE_RAND
public static final int HASH
public static final int ENCRYPT
public static final int DECRYPT
public static final int COMPRESS
public static final int EXPAND
public static final int ZERO
public static final int RANDOM_UUID
public static final int COSH
public static final int SINH
public static final int TANH
public static final int ASCII
public static final int BIT_LENGTH
public static final int CHAR
public static final int CHAR_LENGTH
public static final int CONCAT
public static final int DIFFERENCE
public static final int HEXTORAW
public static final int INSERT
public static final int INSTR
public static final int LCASE
public static final int LEFT
public static final int LENGTH
public static final int LOCATE
public static final int LTRIM
public static final int OCTET_LENGTH
public static final int RAWTOHEX
public static final int REPEAT
public static final int REPLACE
public static final int RIGHT
public static final int RTRIM
public static final int SOUNDEX
public static final int SPACE
public static final int SUBSTR
public static final int SUBSTRING
public static final int UCASE
public static final int LOWER
public static final int UPPER
public static final int POSITION
public static final int TRIM
public static final int STRINGENCODE
public static final int STRINGDECODE
public static final int STRINGTOUTF8
public static final int UTF8TOSTRING
public static final int XMLATTR
public static final int XMLNODE
public static final int XMLCOMMENT
public static final int XMLCDATA
public static final int XMLSTARTDOC
public static final int XMLTEXT
public static final int REGEXP_REPLACE
public static final int RPAD
public static final int LPAD
public static final int CURDATE
public static final int CURTIME
public static final int DATE_ADD
public static final int DATE_DIFF
public static final int DAY_NAME
public static final int DAY_OF_MONTH
public static final int DAY_OF_WEEK
public static final int DAY_OF_YEAR
public static final int HOUR
public static final int MINUTE
public static final int MONTH
public static final int MONTH_NAME
public static final int NOW
public static final int QUARTER
public static final int SECOND
public static final int WEEK
public static final int YEAR
public static final int CURRENT_DATE
public static final int CURRENT_TIME
public static final int CURRENT_TIMESTAMP
public static final int EXTRACT
public static final int FORMATDATETIME
public static final int PARSEDATETIME
public static final int ISO_YEAR
public static final int ISO_WEEK
public static final int ISO_DAY_OF_WEEK
public static final int DATABASE
public static final int USER
public static final int CURRENT_USER
public static final int IDENTITY
public static final int SCOPE_IDENTITY
public static final int AUTOCOMMIT
public static final int READONLY
public static final int DATABASE_PATH
public static final int LOCK_TIMEOUT
public static final int IFNULL
public static final int CASEWHEN
public static final int CONVERT
public static final int CAST
public static final int COALESCE
public static final int NULLIF
public static final int CASE
public static final int NEXTVAL
public static final int CURRVAL
public static final int ARRAY_GET
public static final int CSVREAD
public static final int CSVWRITE
public static final int MEMORY_FREE
public static final int MEMORY_USED
public static final int LOCK_MODE
public static final int SCHEMA
public static final int SESSION_ID
public static final int ARRAY_LENGTH
public static final int LINK_SCHEMA
public static final int GREATEST
public static final int LEAST
public static final int CANCEL_SESSION
public static final int SET
public static final int TABLE
public static final int TABLE_DISTINCT
public static final int FILE_READ
public static final int TRANSACTION_ID
public static final int TRUNCATE_VALUE
public static final int NVL2
public static final int ROW_NUMBER
protected Expression[] args
protected Function(Database database, org.h2.expression.FunctionInfo info)
public static Function getFunction(Database database, String name)
database
- the databasename
- the function namepublic void setParameter(int index, Expression param)
index
- the index (0, 1,...)param
- the expressionpublic Value getValue(Session session)
Expression
getValue
in class Expression
session
- the sessionpublic static boolean isDatePart(String part)
part
- the stringpublic int getType()
Expression
getType
in interface FunctionCall
getType
in class Expression
public void mapColumns(ColumnResolver resolver, int level)
Expression
mapColumns
in class Expression
resolver
- the column resolverlevel
- the subquery nesting levelprotected void checkParameterCount(int len)
len
- the number of parameters setDbException
- if the parameter count is incorrectpublic void doneWithParameters()
DbException
- if the parameter count is incorrect.public void setDataType(Column col)
public Expression optimize(Session session)
Expression
optimize
in interface FunctionCall
optimize
in class Expression
session
- the sessionpublic void setEvaluatable(TableFilter tableFilter, boolean b)
Expression
setEvaluatable
in class Expression
tableFilter
- the table filterb
- true if the table filter can return valuepublic int getScale()
Expression
getScale
in class Expression
public long getPrecision()
Expression
getPrecision
in class Expression
public int getDisplaySize()
Expression
getDisplaySize
in class Expression
public String getSQL()
Expression
getSQL
in interface FunctionCall
getSQL
in class Expression
public void updateAggregate(Session session)
Expression
updateAggregate
in class Expression
session
- the sessionpublic int getFunctionType()
public String getName()
FunctionCall
getName
in interface FunctionCall
public int getParameterCount()
FunctionCall
getParameterCount
in interface FunctionCall
public ValueResultSet getValueForColumnList(Session session, Expression[] argList)
FunctionCall
getValueForColumnList
in interface FunctionCall
session
- the sessionargList
- the argument list (some arguments may be null)public Expression[] getArgs()
FunctionCall
getArgs
in interface FunctionCall
public boolean isEverything(ExpressionVisitor visitor)
Expression
isEverything
in class Expression
visitor
- the visitorpublic int getCost()
Expression
getCost
in class Expression
public boolean isDeterministic()
FunctionCall
isDeterministic
in interface FunctionCall
public boolean isFast()
FunctionCall
isFast
in interface FunctionCall
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.