1 24 25 package com.mckoi.database; 26 27 37 38 public class CorrelatedVariable implements Cloneable , java.io.Serializable { 39 40 static final long serialVersionUID = -607848111230634419L; 41 42 45 private Variable variable; 46 47 51 private int query_level_offset; 52 53 56 private transient TObject eval_result; 57 58 59 62 public CorrelatedVariable(Variable variable, int level_offset) { 63 this.variable = variable; 64 this.query_level_offset = level_offset; 65 } 66 67 70 public Variable getVariable() { 71 return variable; 72 } 73 74 79 public int getQueryLevelOffset() { 80 return query_level_offset; 81 } 82 83 86 public void setEvalResult(TObject ob) { 87 this.eval_result = ob; 88 } 89 90 94 public void setFromResolver(VariableResolver resolver) { 95 Variable v = getVariable(); 96 setEvalResult(resolver.resolve(v)); 97 } 98 99 102 public TObject getEvalResult() { 103 return eval_result; 104 } 105 106 109 public TType returnTType() { 110 return eval_result.getTType(); 111 } 112 113 114 117 public Object clone() throws CloneNotSupportedException { 118 CorrelatedVariable v = (CorrelatedVariable) super.clone(); 119 v.variable = (Variable) variable.clone(); 120 return v; 121 } 122 123 public String toString() { 124 return "CORRELATED: " + getVariable() + " = " + getEvalResult(); 125 } 126 127 } 128 | Popular Tags |