public class TConstant extends TParseTreeNode
getLiteralType()
returns the type of this constant, getValueToken()
returns the value of this constant.
TParseTreeNode.toString()
returns the text of this constant.
Constructor and Description |
---|
TConstant() |
TConstant(ELiteralType pLiteralType)
Class constructor, set the type of this constant while creating a new instance of the constant
|
TConstant(ELiteralType literalType,
TSourceToken valueToken)
Class constructor, set the type and value of this constant when creating a new instance of the constant
|
TConstant(ELiteralType literalType,
TSourceToken valueToken,
EIntervalType intervalType)
Class constructor, set the type and value of this constant when creating a new instance of the constant.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TParseTreeVisitor v)
Accept a visitor
|
void |
acceptChildren(TParseTreeVisitor v)
Accept a visitor to iterate this class and sub-nodes of this class
|
TSourceToken |
getBind1() |
TSourceToken |
getBind2() |
TTypeName |
getCastType()
Constants can be specified with explicit types.
|
TSourceToken |
getFractionalSecondsPrecision()
the number of digits in the fractional part of the SECOND datetime field in a interval day to second constant.
|
TSourceToken |
getIndicator() |
EIntervalType |
getIntervalType()
Oracle interval year to month and interval day to second constant.
|
TSourceToken |
getLeadingPrecision()
the maximum number of digits in the leading field of a interval constant.
|
ELiteralType |
getLiteralType()
get type of this constant, can be strings, integers, and floating point numbers and more.
|
TSourceToken |
getSign()
The '+' or '-' before this constant.
|
TSourceTokenList |
getStringLiteralSequence()
String list constant in Hive.
|
String |
getStringValue()
Deprecated.
since 1.8.2.4, use
getValue() instead. |
String |
getValue()
Deprecated.
use
getValueToken() instead |
TSourceToken |
getValueToken()
The value of this constant represented by a source token.
|
void |
init(Object arg1)
Initialize a query tree node.
|
void |
init(Object arg1,
Object arg2) |
void |
init(Object arg1,
Object arg2,
Object arg3) |
void |
init(Object arg1,
Object arg2,
Object arg3,
Object arg4) |
void |
setBind1(TSourceToken bind1) |
void |
setBind2(TSourceToken bind2) |
void |
setCastType(TTypeName castType)
Set the explicit type of this constant
|
void |
setFractionalSecondsPrecision(TSourceToken fractionalSecondsPrecision)
set the fractional precision which is the number of digits in the fractional part of the SECOND datetime field
in a interval day to second constant.
|
void |
setIndicator(TSourceToken indicator) |
void |
setIntervalType(EIntervalType intervalType)
Set the sub-type of interval constant
|
void |
setLeadingPrecision(TSourceToken leadingPrecision)
set the precision which is the maximum number of digits in the leading field of a interval constant.
|
void |
setLiteralType(ELiteralType literalType)
The type of this constant.
|
void |
setSign(TSourceToken sign)
The '+' or '-' before this constant.
|
void |
setStringLiteralSequence(TSourceTokenList stringLiteralSequence) |
void |
setStringValue(String stringValue)
Deprecated.
use
getValueToken() instead |
void |
setValueToken(TSourceToken valueToken)
set value of this constant
|
addAllMyTokensToTokenList, appendString, doParse, fastSetString, getColumnNo, getDummyTag, getEndToken, getGsqlparser, getLineNo, getNodeType, getStartToken, init, init, removeAllMyTokensFromTokenList, setDummyTag, setEndToken, setEndToken, setEndToken, setEndToken, setGsqlparser, setIncludingComment, setNodeType, setStartToken, setStartToken, setStartToken, setStartToken, setString, toScript, toString
public TConstant()
public TConstant(ELiteralType pLiteralType)
pLiteralType
- type of this constantpublic TConstant(ELiteralType literalType, TSourceToken valueToken)
literalType
- type of this constantvalueToken
- value of this constantpublic TConstant(ELiteralType literalType, TSourceToken valueToken, EIntervalType intervalType)
literalType
- type of this constant, must be etIntervalvalueToken
- value of this constantintervalType
- sub-type of an interval constantpublic void setCastType(TTypeName castType)
castType
- explicit typegetCastType()
public TTypeName getCastType()
type 'string' 'string'::type CAST 'string' AS type
public void setIntervalType(EIntervalType intervalType)
intervalType
- sub-type of interval constantgetIntervalType()
public EIntervalType getIntervalType()
public void setValueToken(TSourceToken valueToken)
INTERVAL '30.12345' SECOND(2,4)'30.12345' in the above SQL in the valueToken
valueToken
- value of this constantpublic void setLeadingPrecision(TSourceToken leadingPrecision)
INTERVAL '400 5' DAY(3) TO HOUR3 in the above SQL is the
leadingPrecision
leadingPrecision
- the precision of the leading fieldpublic void setFractionalSecondsPrecision(TSourceToken fractionalSecondsPrecision)
INTERVAL '30.12345' SECOND(2,4)4 in the above SQL is the
fractionalSecondsPrecision
, 2 is the leadingPrecision
fractionalSecondsPrecision
- public TSourceToken getLeadingPrecision()
INTERVAL '400 5' DAY(3) TO HOUR3 in the above SQL is the
leadingPrecision
public TSourceToken getFractionalSecondsPrecision()
INTERVAL '30.12345' SECOND(2,4)4 in the above SQL is the
fractionalSecondsPrecision
, 2 is the leadingPrecision
public void setStringValue(String stringValue)
getValueToken()
insteadstringValue
- text value of this constantpublic String getValue()
getValueToken()
insteadpublic String getStringValue()
getValue()
instead.public ELiteralType getLiteralType()
ELiteralType
for more type of constantpublic void setStringLiteralSequence(TSourceTokenList stringLiteralSequence)
public TSourceTokenList getStringLiteralSequence()
public void setSign(TSourceToken sign)
getLiteralType()
is ELiteralType.etNumber
sign
- the '+' or '-' tokenpublic TSourceToken getSign()
getLiteralType()
is ELiteralType.etNumber
public TSourceToken getValueToken()
public void accept(TParseTreeVisitor v)
TParseTreeNode
accept
in interface Visitable
accept
in class TParseTreeNode
v
- visitor is a descendant class of TParseTreeVisitor
public void acceptChildren(TParseTreeVisitor v)
TParseTreeNode
acceptChildren
in interface Visitable
acceptChildren
in class TParseTreeNode
v
- visitor is a descendant class of TParseTreeVisitor
public void init(Object arg1)
TParseTreeNode
init
in class TParseTreeNode
arg1
- first argumentpublic void setLiteralType(ELiteralType literalType)
The most used type are: etNumber,etFloat,etString,etTimestamp,etDate,etInterval
literalType
- the type of this constantpublic void init(Object arg1, Object arg2)
init
in class TParseTreeNode
public void setBind1(TSourceToken bind1)
public void setBind2(TSourceToken bind2)
public void setIndicator(TSourceToken indicator)
public TSourceToken getBind1()
public TSourceToken getBind2()
public TSourceToken getIndicator()
public void init(Object arg1, Object arg2, Object arg3)
init
in class TParseTreeNode
Copyright © 2019. All rights reserved.