Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ValueType

所有值类型的基类。

Hierarchy

Index

Methods

clone

  • 克隆当前值。克隆的结果值应与当前值相等,即满足 this.equals(this, value.clone())

    本方法的基类版本简单地返回 this; 派生类必须重写本方法,并且返回的对象不应当为 this,即满足 this !== this.clone()

    Returns ValueType

    克隆结果值。

equals

  • equals(other: this): boolean
  • 判断当前值是否与指定值相等。此判断应当具有交换性,即满足 this.equals(other) === other.equals(this)。 本方法的基类版本简单地返回 false

    Parameters

    • other: this

      相比较的值。

    Returns boolean

    相等则返回 true,否则返回 false

set

  • set(other: this): void
  • 赋值当前值使其与指定值相等,即在 this.set(other) 之后应有 this.equals(other)。 本方法的基类版本简单地返回 this,派生类必须重写本方法。

    Parameters

    • other: this

      相比较的值。

    Returns void

toString

  • toString(): string

Generated using TypeDoc