Package com.mckoi.database
Class CorrelatedVariable
- java.lang.Object
-
- com.mckoi.database.CorrelatedVariable
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class CorrelatedVariable extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
A wrapper for a variable in a sub-query that references a column outside of the current query. A correlated variable differs from a regular variable because its value is constant in an operation, but may vary over future iterations of the operation.This object is NOT immutable.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private TObject
eval_result
The temporary value this variable has been set to evaluate to.private int
query_level_offset
The number of sub-query branches back that the reference for this variable can be found.(package private) static long
serialVersionUID
private Variable
variable
The Variable reference itself.
-
Constructor Summary
Constructors Constructor Description CorrelatedVariable(Variable variable, int level_offset)
Constructs the CorrelatedVariable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Clones the object.TObject
getEvalResult()
Returns the value this correlated variable evaluates to.int
getQueryLevelOffset()
Returns the number of sub-query branches back that the reference for this variable can be found.Variable
getVariable()
Returns the wrapped Variable.TType
returnTType()
Returns the TType this correlated variable evaluates to.void
setEvalResult(TObject ob)
Sets the value this correlated variable evaluates to.void
setFromResolver(VariableResolver resolver)
Given a VariableResolver this will set the value of the correlated variable.java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
variable
private Variable variable
The Variable reference itself.
-
query_level_offset
private int query_level_offset
The number of sub-query branches back that the reference for this variable can be found.
-
eval_result
private transient TObject eval_result
The temporary value this variable has been set to evaluate to.
-
-
Constructor Detail
-
CorrelatedVariable
public CorrelatedVariable(Variable variable, int level_offset)
Constructs the CorrelatedVariable.
-
-
Method Detail
-
getVariable
public Variable getVariable()
Returns the wrapped Variable.
-
getQueryLevelOffset
public int getQueryLevelOffset()
Returns the number of sub-query branches back that the reference for this variable can be found. For example, if the correlated variable references the direct descendant this will return 1.
-
setEvalResult
public void setEvalResult(TObject ob)
Sets the value this correlated variable evaluates to.
-
setFromResolver
public void setFromResolver(VariableResolver resolver)
Given a VariableResolver this will set the value of the correlated variable.
-
getEvalResult
public TObject getEvalResult()
Returns the value this correlated variable evaluates to.
-
returnTType
public TType returnTType()
Returns the TType this correlated variable evaluates to.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Clones the object.- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-