本文整理汇总了TypeScript中collection-utils.hashCodeOf函数的典型用法代码示例。如果您正苦于以下问题:TypeScript hashCodeOf函数的具体用法?TypeScript hashCodeOf怎么用?TypeScript hashCodeOf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hashCodeOf函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private readonly _kind: TypeKind, private readonly _components: ReadonlyArray<any>) {
let h = hashCodeInit;
h = addHashCode(h, hashCodeOf(this._kind));
for (const c of _components) {
h = addHashCode(h, hashCodeOf(c));
}
this._hashCode = h;
}
示例2: hashCode
hashCode(): number {
let h = super.hashCode();
h = addHashCode(h, hashCodeOf(this.nullTransformer));
h = addHashCode(h, hashCodeOf(this.integerTransformer));
h = addHashCode(h, hashCodeOf(this.doubleTransformer));
h = addHashCode(h, hashCodeOf(this.boolTransformer));
h = addHashCode(h, hashCodeOf(this.stringTransformer));
h = addHashCode(h, hashCodeOf(this.arrayTransformer));
h = addHashCode(h, hashCodeOf(this.objectTransformer));
return h;
}
示例3: hashCode
hashCode(): number {
return hashCodeOf(this.typeData) + (this.isOptional ? 17 : 23);
}