public final class Var extends ExprInfo
Modifier and Type | Field and Description |
---|---|
Data |
data
Data reference.
|
SeqType |
declType
Declared sequence type,
null if not specified. |
int |
id
Variable ID.
|
QNm |
name
Variable name.
|
long |
size
Expected result size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
adoptCheck(SeqType st,
boolean prom)
Tries to adopt the given type check.
|
Expr |
checked(Expr ex,
QueryContext qc,
VarScope scp,
InputInfo ii)
Returns an equivalent to the given expression that checks this variable's type.
|
boolean |
checksType()
Determines if this variable checks the type of the expression bound to it.
|
void |
checkType(Expr expr,
InputInfo info)
Checks if the type of the specified expression could be converted to the sequence type
of this variable.
|
Value |
checkType(Value val,
QueryContext qc,
InputInfo ii,
boolean opt)
Checks the type of this value and casts/promotes it when necessary.
|
SeqType |
declaredType()
Declared type of this variable.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
is(Var var)
Checks whether the given variable is identical to this one, i.e. has the same ID.
|
void |
plan(FElem plan)
Creates an expression tree.
|
boolean |
promotes()
Checks if this variable performs function conversion on its bound values.
|
void |
refineType(SeqType st,
QueryContext qc,
InputInfo ii)
Tries to refine the compile-time type of this variable through the type of the bound
expression.
|
SeqType |
seqType()
Sequence type of values bound to this variable.
|
String |
toErrorString()
Returns a string representation of the expression that can be embedded in error messages.
|
String |
toString() |
public final QNm name
public final int id
public SeqType declType
null
if not specified.public long size
public Data data
public SeqType seqType()
null
)public SeqType declaredType()
null
)public void refineType(SeqType st, QueryContext qc, InputInfo ii) throws QueryException
st
- sequence type of the bound expressionqc
- query contextii
- input infoQueryException
- query exceptionpublic boolean checksType()
true
if the type is checked or promoted, false
otherwisepublic Expr checked(Expr ex, QueryContext qc, VarScope scp, InputInfo ii) throws QueryException
ex
- expressionscp
- variable scopeqc
- query contextii
- input infoQueryException
- query exceptionpublic Value checkType(Value val, QueryContext qc, InputInfo ii, boolean opt) throws QueryException
val
- value to be checkedqc
- query contextii
- input infoopt
- if the result should be optimizedQueryException
- if the check failedpublic void checkType(Expr expr, InputInfo info) throws QueryException
expr
- expressioninfo
- input infoQueryException
- query exceptionpublic boolean is(Var var)
var
- variable to checktrue
if the IDs are equal, false
otherwisepublic boolean promotes()
public boolean adoptCheck(SeqType st, boolean prom)
st
- type to checkprom
- if function conversion should be appliedtrue
if the check could be adopted, false
otherwisepublic void plan(FElem plan)
ExprInfo
public String toErrorString()
ExprInfo
ExprInfo.toString()
.toErrorString
in class ExprInfo
Copyright © 2005–2015 BaseX Team. All rights reserved.