Package com.mckoi.database
Class CorrelatedVariable
java.lang.Object
com.mckoi.database.CorrelatedVariable
- All Implemented Interfaces:
Serializable
,Cloneable
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.
- Author:
- Tobias Downer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCorrelatedVariable
(Variable variable, int level_offset) Constructs the CorrelatedVariable. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the object.Returns the value this correlated variable evaluates to.int
Returns the number of sub-query branches back that the reference for this variable can be found.Returns the wrapped Variable.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.toString()
-
Constructor Details
-
CorrelatedVariable
Constructs the CorrelatedVariable.
-
-
Method Details
-
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
Sets the value this correlated variable evaluates to. -
setFromResolver
Given a VariableResolver this will set the value of the correlated variable. -
getEvalResult
Returns the value this correlated variable evaluates to. -
returnTType
Returns the TType this correlated variable evaluates to. -
clone
Clones the object.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
toString
-