未验证 提交 af495c61 编写于 作者: O openharmony_ci 提交者: Gitee

!2182 Align the docs document with the d.ts document

Merge pull request !2182 from wangyong/sevendocs
......@@ -154,7 +154,6 @@ deque.insertEnd(4);
deque.insertFront(5);
deque.insertFront(2);
deque.insertFront(4);
deque.popLast();
let result = deque.popLast();
```
......
......@@ -319,7 +319,7 @@ let result = hashMap.replace("sdfs", 357);
### forEach
forEach(callbackfn: (value: V, key?: K, map?: HashMap<K, V>) => void, thisArg?: Object): void
forEach(callbackfn: (value?: V, key?: K, map?: HashMap<K, V>) => void, thisArg?: Object): void
通过回调函数来遍历HashMap实例对象上的元素以及元素对应的下标。
......
......@@ -184,7 +184,7 @@ while(temp != undefined) {
### forEach
forEach(callbackfn: (value: T, key?: T, set?: HashSet&lt;T&gt;) => void, thisArg?: Object): void
forEach(callbackfn: (value?: T, key?: T, set?: HashSet&lt;T&gt;) => void, thisArg?: Object): void
通过回调函数来遍历实例对象上的元素以及元素对应的下标。
......
......@@ -510,7 +510,7 @@ while(temp != undefined) {
### forEach
forEach(callbackfn: (value: V, key?: K, map?: LightWeightMap<K, V>) => void, thisArg?: Object): void
forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap<K, V>) => void, thisArg?: Object): void
通过回调函数来遍历实例对象上的元素以及元素对应的下标。
......@@ -569,7 +569,7 @@ while(temp != undefined) {
### toString
toString(): string
toString(): String
将此映射中包含的键值对拼接成字符串,并返回字符串类型。
......@@ -577,7 +577,7 @@ toString(): string
| 类型 | 说明 |
| -------- | -------- |
| string | 返回一个字符串。 |
| String | 返回一个字符串。 |
**示例:**
......
......@@ -414,7 +414,7 @@ while(index < lightWeightSet.length) {
### forEach
forEach(callbackfn: (value: T, key?: T, set?: LightWeightSet&lt;T&gt;) => void, thisArg?: Object): void
forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet&lt;T&gt;) => void, thisArg?: Object): void
通过回调函数来遍历LightWeightSet实例对象上的元素以及元素对应的下标。
......
......@@ -27,16 +27,10 @@ SystemCapability.Utils.Lang
### constructor
constructor(head?: NodeObj&lt;T&gt;, tail?: NodeObj&lt;T&gt;)
constructor()
LinkedList的构造函数。
**参数:**
| 参数名 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| head | NodeObj&lt;T&gt; | 是 | 否 | 节点对象,含有element、next指向和prev指向。 |
| tail | NodeObj&lt;T&gt; | 是 | 否 | 节点对象,含有element、next指向和prev指向。 |
**示例:**
......@@ -300,7 +294,7 @@ let result = linkedList.removeFirst();
### removeLast
removeLst(): T
removeLast(): T
删除并返回LinkedList的最后一个元素。
......
......@@ -27,15 +27,10 @@ SystemCapability.Utils.Lang
### constructor
constructor(head?: NodeObj&lt;T&gt;)
constructor()
List的构造函数。
**参数:**
| 参数名 | 类型 | 可读 | 说明 |
| -------- | -------- | -------- | -------- |
| head | NodeObj&lt;T&gt; | 是 | 节点对象,含有element、next指向。 |
**示例:**
......@@ -465,6 +460,7 @@ list.clear();
### set
set(index: number, element: T): T
将此 List 中指定位置的元素替换为指定元素。
**参数:**
......
......@@ -416,7 +416,7 @@ plainArray.clear();
### forEach
forEach(callbackfn: (value: T, key?: number, PlainArray?: PlainArray<number, T>) => void, thisArg?: Object): void
forEach(callbackfn: (value?: T, index?: number, PlainArray?: PlainArray<T>) => void, thisArg?: Object): void
通过回调函数来遍历实例对象上的元素以及元素对应的下标。
......@@ -431,8 +431,8 @@ callbackfn的参数说明:
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | T | 是 | 当前遍历到的元素键值对的值。 |
| key | number | 是 | 当前遍历到的元素键值对的键。 |
| plainArray | PlainArray<number, T> | 否 | 当前调用forEach方法的实例对象。 |
| index | number | 是 | 当前遍历到的元素键值对的键。 |
| plainArray | PlainArray<T> | 否 | 当前调用forEach方法的实例对象。 |
**示例:**
......
......@@ -569,6 +569,7 @@ let result = vector.toSting();
### copyToArray
copyToArray(array: Array&lt;T&gt;): void
将Vector实例中的元素按照下标复制到指定数组。
**参数:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册