本文整理汇总了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
}