提交 5bdcd900 编写于 作者: G Gloria

Update docs against 19678

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 4692348c
...@@ -379,15 +379,15 @@ Replaces all elements in this container with new elements, and returns the new o ...@@ -379,15 +379,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for the replacement.| | callbackFn | function | Yes| Callback invoked for the replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| arrlist | ArrayList&lt;T&gt; | No| Instance that invokes the **replaceAllElements** method.| | arrlist | ArrayList&lt;T&gt; | No| Instance that calls the **replaceAllElements** API. The default value is this instance.|
**Error codes** **Error codes**
...@@ -425,15 +425,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -425,15 +425,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for the replacement.| | callbackFn | function | Yes| Callback invoked for the replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is 0.|
| arrlist | ArrayList&lt;T&gt; | No| Instance that invokes the **forEach** method.| | arrlist | ArrayList&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
...@@ -468,7 +468,7 @@ Sorts elements in this container. ...@@ -468,7 +468,7 @@ Sorts elements in this container.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| comparator | function | No| Callback invoked for sorting.| | comparator | function | No| Callback invoked for sorting. The default value is the callback function for sorting elements in ascending order.|
comparator comparator
......
...@@ -204,7 +204,7 @@ Concatenates an array of **Buffer** instances of the specified length into a new ...@@ -204,7 +204,7 @@ Concatenates an array of **Buffer** instances of the specified length into a new
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| list | Buffer[]&nbsp;\|&nbsp;Uint8Array[] | Yes| Array of instances to concatenate.| | list | Buffer[]&nbsp;\|&nbsp;Uint8Array[] | Yes| Array of instances to concatenate.|
| totalLength | number | No| Total length of bytes to be copied.| | totalLength | number | No| Total length of bytes to be copied. The default value is **0**.|
**Return value** **Return value**
...@@ -1915,7 +1915,7 @@ Converts the data at the specified position in this **Buffer** instance into a s ...@@ -1915,7 +1915,7 @@ Converts the data at the specified position in this **Buffer** instance into a s
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| encoding | string | No| Encoding format of the string. The default value is **utf-8**.| | encoding | string | No| Encoding format (valid only when **value** is a string). The default value is **utf-8**.|
| start | number | No| Offset to the start position of the data to convert. The default value is **0**.| | start | number | No| Offset to the start position of the data to convert. The default value is **0**.|
| end | number | No| Offset to the end position of the data to convert. The default value is the length of this **Buffer** instance.| | end | number | No| Offset to the end position of the data to convert. The default value is the length of this **Buffer** instance.|
......
...@@ -242,15 +242,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -242,15 +242,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| deque | Deque&lt;T&gt; | No| Instance that invokes the **forEach** method.| | deque | Deque&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -459,14 +459,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -459,14 +459,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.| | value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key | K | No| Key of the element that is currently traversed.| | key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.|
| map | HashMap<K, V> | No| Instance that invokes the **forEach** method.| | map | HashMap<K, V> | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -282,14 +282,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -282,14 +282,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.| | value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key | T | No| Key of the element that is currently traversed (same as **value**).| | key | T | No| Key of the element that is currently traversed (same as **value**). The default value is the key of the first key-value pair.|
| set | HashSet&lt;T&gt; | No| Instance that invokes the **forEach** API.| | set | HashSet&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -724,14 +724,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -724,14 +724,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.| | value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key | K | No| Key of the element that is currently traversed.| | key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.|
| map | LightWeightMap<K, V> | No| Instance that invokes the **forEach** method.| | map | LightWeightMap<K, V> | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -588,14 +588,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -588,14 +588,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.| | value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key| T | No| Key of the element that is currently traversed (same as **value**).| | key| T | No| Key of the element that is currently traversed (same as **value**). The default value is the key of the first key-value pair.|
| set | LightWeightSet&lt;T&gt; | No| Instance that invokes the **forEach** method.| | set | LightWeightSet&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -607,15 +607,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -607,15 +607,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| LinkedList | LinkedList&lt;T&gt; | No| Instance that invokes the **forEach** API.| | LinkedList | LinkedList&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -427,15 +427,15 @@ Replaces all elements in this container with new elements, and returns the new o ...@@ -427,15 +427,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Value Type | Mandatory| Description| | Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for the replacement.| | callbackFn | function | Yes| Callback invoked for the replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Value Type | Mandatory| Description| | Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| list | List&lt;T&gt; | No| Instance that invokes the **replaceAllElements** method.| | list | List&lt;T&gt; | No| Instance that calls the **replaceAllElements** API. The default value is this instance.|
**Error codes** **Error codes**
...@@ -473,15 +473,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -473,15 +473,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Value Type | Mandatory| Description| | Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for the replacement.| | callbackFn | function | Yes| Callback invoked for the replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Value Type | Mandatory| Description| | Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| List | List&lt;T&gt; | No| Instance that invokes the **forEach** method.| | List | List&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -597,14 +597,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -597,14 +597,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type | Mandatory| Description| | Name| Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type | Mandatory| Description| | Name| Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Key of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| PlainArray | PlainArray&lt;T&gt;| No| Instance that invokes the **forEach** API.| | PlainArray | PlainArray&lt;T&gt;| No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -176,15 +176,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -176,15 +176,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| Queue | Queue&lt;T&gt; | No| Instance that invokes the **forEach** method.| | Queue | Queue&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -214,15 +214,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -214,15 +214,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| stack | Stack&lt;T&gt; | No| Instance that invokes the **forEach** method.| | stack | Stack&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -48,7 +48,7 @@ A constructor used to create a **TreeMap** instance. ...@@ -48,7 +48,7 @@ A constructor used to create a **TreeMap** instance.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| comparator | function | No| Custom comparator.| | comparator | function | No| Custom comparator. The default value is **hole** (a blank placeholder), indicating that no comparator. is provided.|
**Error codes** **Error codes**
...@@ -611,14 +611,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -611,14 +611,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.| | value | V | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key | K | No| Key of the element that is currently traversed.| | key | K | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.|
| map | TreeMap<K, V> | No| Instance that invokes the **forEach** method.| | map | TreeMap<K, V> | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -44,7 +44,7 @@ A constructor used to create a **TreeSet** instance. ...@@ -44,7 +44,7 @@ A constructor used to create a **TreeSet** instance.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| comparator | function | No| Custom comparator.| | comparator | function | No| Custom comparator. The default value is **hole** (a blank placeholder), indicating that no comparator. is provided.|
**Error codes** **Error codes**
...@@ -484,14 +484,14 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -484,14 +484,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked to traverse the elements in the container.| | callbackFn | function | Yes| Callback invoked to traverse the elements in the container.|
| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.| | value | T | No| Value of the element that is currently traversed. The default value is the value of the first key-value pair.|
| key | T | No| Key of the element that is currently traversed.| | key | T | No| Key of the element that is currently traversed. The default value is the key of the first key-value pair.|
| set | TreeSet&lt;T&gt; | No| Instance that invokes the **forEach** method.| | set | TreeSet&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Error codes** **Error codes**
......
...@@ -586,7 +586,7 @@ result = textEncoder.encodeInto("\uD800¥¥"); ...@@ -586,7 +586,7 @@ result = textEncoder.encodeInto("\uD800¥¥");
### encodeIntoUint8Array<sup>9+</sup> ### encodeIntoUint8Array<sup>9+</sup>
encodeIntoUint8Array(input: string, dest: Uint8Array, ): { read: number; written: number } encodeIntoUint8Array(input: string, dest: Uint8Array): { read: number; written: number }
Stores the UTF-8 encoded text. Stores the UTF-8 encoded text.
...@@ -617,7 +617,7 @@ result = that.encodeIntoUint8Array('abcd', dest) ...@@ -617,7 +617,7 @@ result = that.encodeIntoUint8Array('abcd', dest)
### encodeInto<sup>(deprecated)</sup> ### encodeInto<sup>(deprecated)</sup>
encodeInto(input: string, dest: Uint8Array, ): { read: number; written: number } encodeInto(input: string, dest: Uint8Array): { read: number; written: number }
Stores the UTF-8 encoded text. Stores the UTF-8 encoded text.
...@@ -1100,7 +1100,7 @@ A constructor used to create a **LruCache** instance. The default capacity of th ...@@ -1100,7 +1100,7 @@ A constructor used to create a **LruCache** instance. The default capacity of th
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ---------------------------- | | -------- | ------ | ---- | ---------------------------- |
| capacity | number | No | Capacity of the **LruCache** to create.| | capacity | number | No | Capacity of the **LruCache** to create. The default value is **64**.|
**Example** **Example**
...@@ -3400,7 +3400,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t ...@@ -3400,7 +3400,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| capacity | number | No| Capacity of the **LruBuffer** to create.| | capacity | number | No| Capacity of the **LruBuffer** to create. The default value is **64**.|
**Example** **Example**
......
...@@ -304,15 +304,15 @@ Replaces all elements in this container with new elements, and returns the new o ...@@ -304,15 +304,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for replacement.| | callbackFn | function | Yes| Callback invoked for replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| vector | Vector&lt;T&gt; | No| Instance that invokes the **replaceAllElements** API.| | vector | Vector&lt;T&gt; | No| Instance that calls the **replaceAllElements** API. The default value is this instance.|
**Example** **Example**
...@@ -342,15 +342,15 @@ Uses a callback to traverse the elements in this container and obtain their posi ...@@ -342,15 +342,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callbackFn | function | Yes| Callback invoked for replacement.| | callbackFn | function | Yes| Callback invoked for replacement.|
| thisArg | Object | No| Value to use when the callback is invoked.| | thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this instance.|
callbackfn callbackFn
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.| | value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.| | index | number | No| Position index of the element that is currently traversed. The default value is **0**.|
| vector | Vector&lt;T&gt; | No| Instance that invokes the **forEach** API.| | vector | Vector&lt;T&gt; | No| Instance that calls the **forEach** API. The default value is this instance.|
**Example** **Example**
...@@ -378,7 +378,7 @@ Sorts elements in this container. ...@@ -378,7 +378,7 @@ Sorts elements in this container.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| comparator | function | No| Callback invoked for sorting.| | comparator | function | No| Callback invoked for sorting. The default value is this instance.|
comparator comparator
......
...@@ -381,6 +381,7 @@ Creates and returns an **XmlPullParser** object. ...@@ -381,6 +381,7 @@ Creates and returns an **XmlPullParser** object.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<!DOCTYPE note [\n<!ENTITY foo "baa">]>' + '<!DOCTYPE note [\n<!ENTITY foo "baa">]>' +
...@@ -432,6 +433,7 @@ Parses XML information. ...@@ -432,6 +433,7 @@ Parses XML information.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -499,6 +501,7 @@ Obtains the column line number, starting from 1. ...@@ -499,6 +501,7 @@ Obtains the column line number, starting from 1.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -542,6 +545,7 @@ Obtains the depth of this element. ...@@ -542,6 +545,7 @@ Obtains the depth of this element.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -588,6 +592,7 @@ Obtains the current line number, starting from 1. ...@@ -588,6 +592,7 @@ Obtains the current line number, starting from 1.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -631,6 +636,7 @@ Obtains the name of this element. ...@@ -631,6 +636,7 @@ Obtains the name of this element.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -673,6 +679,7 @@ Obtains the namespace of this element. ...@@ -673,6 +679,7 @@ Obtains the namespace of this element.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -715,6 +722,7 @@ Obtains the prefix of this element. ...@@ -715,6 +722,7 @@ Obtains the prefix of this element.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -758,6 +766,7 @@ Obtains the text of the current event. ...@@ -758,6 +766,7 @@ Obtains the text of the current event.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -800,6 +809,7 @@ Checks whether the current element is empty. ...@@ -800,6 +809,7 @@ Checks whether the current element is empty.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -842,6 +852,7 @@ Checks whether the current text event contains only whitespace characters. ...@@ -842,6 +852,7 @@ Checks whether the current text event contains only whitespace characters.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
...@@ -883,6 +894,7 @@ Obtains the number of attributes for the current start tag. ...@@ -883,6 +894,7 @@ Obtains the number of attributes for the current start tag.
**Example** **Example**
```js ```js
import util from '@ohos.util';
let strXml = let strXml =
'<?xml version="1.0" encoding="utf-8"?>' + '<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' + '<note importance="high" logged="true">' +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册