Package com.alibaba.druid.sql.ast.expr
Class SQLNumberExpr
- java.lang.Object
-
- com.alibaba.druid.sql.ast.SQLObjectImpl
-
- com.alibaba.druid.sql.ast.SQLExprImpl
-
- com.alibaba.druid.sql.ast.expr.SQLTypeExpr
-
- com.alibaba.druid.sql.ast.expr.SQLNumericLiteralExpr
-
- com.alibaba.druid.sql.ast.expr.SQLNumberExpr
-
- All Implemented Interfaces:
SQLLiteralExpr,SQLValuableExpr,SQLExpr,SQLObject,SQLReplaceable,Cloneable
public class SQLNumberExpr extends SQLNumericLiteralExpr implements SQLValuableExpr
-
-
Field Summary
Fields Modifier and Type Field Description static SQLDataTypeDATA_TYPE_BIGINTstatic SQLDataTypeDATA_TYPE_DOUBLEstatic SQLDataTypeDATA_TYPE_NUMBER-
Fields inherited from class com.alibaba.druid.sql.ast.expr.SQLTypeExpr
dataType, value
-
Fields inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
parenthesized, parenthesizedCount
-
Fields inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
attributes, hint, parent, sourceColumn, sourceLine
-
-
Constructor Summary
Constructors Constructor Description SQLNumberExpr()SQLNumberExpr(char[] chars)SQLNumberExpr(char[] chars, SQLObject parent)SQLNumberExpr(Number number)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaccept0(SQLASTVisitor visitor)SQLNumberExprclone()SQLDataTypecomputeDataType()booleanequals(Object obj)NumbergetNumber()NumbergetValue()inthashCode()static booleanisOne(SQLExpr x)static booleanisZero(SQLExpr x)voidoutput(StringBuilder buf)voidsetNumber(Number number)-
Methods inherited from class com.alibaba.druid.sql.ast.expr.SQLNumericLiteralExpr
getChildren
-
Methods inherited from class com.alibaba.druid.sql.ast.expr.SQLTypeExpr
getDataType, replace, setDataType, setValue
-
Methods inherited from class com.alibaba.druid.sql.ast.SQLExprImpl
cloneTo, getParenthesizedCount, increaseParenthesizedCount, isParenthesized, setParenthesized, setParenthesizedCount
-
Methods inherited from class com.alibaba.druid.sql.ast.SQLObjectImpl
accept, acceptChild, acceptChild, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, cloneTo, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getHint, getParent, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, putAttribute, setHint, setParent, setSource, setSourceLine, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.alibaba.druid.sql.ast.SQLExpr
getChildren, getHint
-
Methods inherited from interface com.alibaba.druid.sql.ast.SQLObject
accept, addAfterComment, addAfterComment, addBeforeComment, addBeforeComment, containsAttribute, getAfterCommentsDirect, getAttribute, getAttributes, getAttributesDirect, getBeforeCommentsDirect, getParent, getParent, getSourceColumn, getSourceLine, hasAfterComment, hasBeforeComment, putAttribute, setParent, setSource
-
-
-
-
Field Detail
-
DATA_TYPE_NUMBER
public static final SQLDataType DATA_TYPE_NUMBER
-
DATA_TYPE_DOUBLE
public static final SQLDataType DATA_TYPE_DOUBLE
-
DATA_TYPE_BIGINT
public static final SQLDataType DATA_TYPE_BIGINT
-
-
Method Detail
-
getNumber
public Number getNumber()
- Specified by:
getNumberin classSQLNumericLiteralExpr
-
getValue
public Number getValue()
- Specified by:
getValuein interfaceSQLValuableExpr- Specified by:
getValuein classSQLTypeExpr
-
setNumber
public void setNumber(Number number)
- Specified by:
setNumberin classSQLNumericLiteralExpr
-
output
public void output(StringBuilder buf)
- Specified by:
outputin interfaceSQLObject- Overrides:
outputin classSQLObjectImpl
-
accept0
protected void accept0(SQLASTVisitor visitor)
- Overrides:
accept0in classSQLTypeExpr
-
hashCode
public int hashCode()
- Overrides:
hashCodein classSQLTypeExpr
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classSQLTypeExpr
-
clone
public SQLNumberExpr clone()
- Specified by:
clonein interfaceSQLExpr- Specified by:
clonein interfaceSQLLiteralExpr- Specified by:
clonein interfaceSQLObject- Specified by:
clonein classSQLNumericLiteralExpr
-
computeDataType
public SQLDataType computeDataType()
- Specified by:
computeDataTypein interfaceSQLExpr- Overrides:
computeDataTypein classSQLTypeExpr
-
isZero
public static boolean isZero(SQLExpr x)
-
isOne
public static boolean isOne(SQLExpr x)
-
-