本文整理匯總了TypeScript中src/exprEnv.ExprEnv.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ExprEnv.get方法的具體用法?TypeScript ExprEnv.get怎麽用?TypeScript ExprEnv.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類src/exprEnv.ExprEnv
的用法示例。
在下文中一共展示了ExprEnv.get方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: calcResult
calcResult(index: number, resultA: number) {
if (this._range == 0)
return NaN;
var first = ExprEnv.get().getFirstIndex();
if (first < 0)
return resultA;
if (index > first) {
var prev = this._buf[index - 1];
return this._alpha * (resultA - prev.result) + prev.result;
}
return resultA;
}
示例2: calcResult
calcResult(index, resultA) {
if (this._range == 0)
return NaN;
var first = ExprEnv.get().getFirstIndex();
if (first < 0)
return resultA;
if (index > first) {
var n = this._range;
if (n > index + 1 - first)
n = index + 1 - first;
return ((n - 1) * this._buf[index - 1].result + resultA * this._mul) / n;
}
return resultA;
}
示例3: calcResult
calcResult(index: number, resultA: number) {
var first = ExprEnv.get().getFirstIndex()
if (first < 0)
return resultA;
if (index > first) {
var n = this._range;
if (n == 0 || n >= index + 1 - first) {
return this._buf[index - 1].result + resultA;
}
return this._buf[index - 1].result + resultA - this._buf[index - n].resultA;
} else {
return resultA;
}
}
示例4: calcResult
calcResult(index, resultA) {
var first = ExprEnv.get().getFirstIndex()
if (first < 0)
return resultA;
if (index > first) {
var n = this._range;
var prev = this._buf[index - 1];
if (n >= index + 1 - first) {
n = index + 1 - first;
return prev.result * (1.0 - 1.0 / n) + (resultA / n);
}
return this._alpha * (resultA - prev.result) + prev.result;
}
return resultA;
}
示例5: calcResult
calcResult(index: number, resultA: number) {
if (this._range == 0)
return NaN;
var first = ExprEnv.get().getFirstIndex();
if (first < 0)
return resultA;
if (index > first) {
var n = this._range;
if (n >= index + 1 - first) {
n = index + 1 - first;
return this._buf[index - 1].result * (1.0 - 1.0 / n) + (resultA / n);
}
return this._buf[index - 1].result + (resultA - this._buf[index - n].resultA) / n;
} else {
return resultA;
}
}
示例6: calcResult
calcResult(index: number, resultA: number) {
if (this._range == 0)
return NaN;
var first = ExprEnv.get().getFirstIndex();
if (first < 0)
return 0;
if (index >= first) {
var n = this._range - 1;
if (n > index - first)
n = index - first;
var count = 0;
for (; n >= 0; n--) {
if (this._buf[index - n].resultA != 0.0)
count++;
}
return count;
} else {
return 0;
}
}
示例7: calcResult
calcResult(index: number, resultA: number) {
if (this._range == 0)
return NaN;
var first = ExprEnv.get().getFirstIndex();
if (first < 0)
return resultA;
if (index > first) {
var n = this._range;
var result = resultA;
var start = index - n + 1;
var i = Math.max(first, start);
for (; i < index; i++) {
var p = this._buf[i];
if (result < p.resultA)
result = p.resultA;
}
return result;
} else {
return resultA;
}
}
示例8: execute
execute(index) {
return ExprEnv.get().getDataSource().getDataAt(index).low
}
示例9: execute
execute(index: number) {
return ExprEnv.get().getDataSource().getDataAt(index).close
}