Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
87f5d0be
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
87f5d0be
编写于
7月 03, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
!20264 翻译完成:19678 补充util模块部分接口可选参数默认值说明,xml模块示例代码修改
Merge pull request !20264 from wusongqing/TR19678
上级
bd4c2724
5bdcd900
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
96 addition
and
84 deletion
+96
-84
en/application-dev/reference/apis/js-apis-arraylist.md
en/application-dev/reference/apis/js-apis-arraylist.md
+9
-9
en/application-dev/reference/apis/js-apis-buffer.md
en/application-dev/reference/apis/js-apis-buffer.md
+2
-2
en/application-dev/reference/apis/js-apis-deque.md
en/application-dev/reference/apis/js-apis-deque.md
+4
-4
en/application-dev/reference/apis/js-apis-hashmap.md
en/application-dev/reference/apis/js-apis-hashmap.md
+5
-5
en/application-dev/reference/apis/js-apis-hashset.md
en/application-dev/reference/apis/js-apis-hashset.md
+5
-5
en/application-dev/reference/apis/js-apis-lightweightmap.md
en/application-dev/reference/apis/js-apis-lightweightmap.md
+5
-5
en/application-dev/reference/apis/js-apis-lightweightset.md
en/application-dev/reference/apis/js-apis-lightweightset.md
+5
-5
en/application-dev/reference/apis/js-apis-linkedlist.md
en/application-dev/reference/apis/js-apis-linkedlist.md
+4
-4
en/application-dev/reference/apis/js-apis-list.md
en/application-dev/reference/apis/js-apis-list.md
+8
-8
en/application-dev/reference/apis/js-apis-plainarray.md
en/application-dev/reference/apis/js-apis-plainarray.md
+4
-4
en/application-dev/reference/apis/js-apis-queue.md
en/application-dev/reference/apis/js-apis-queue.md
+4
-4
en/application-dev/reference/apis/js-apis-stack.md
en/application-dev/reference/apis/js-apis-stack.md
+4
-4
en/application-dev/reference/apis/js-apis-treemap.md
en/application-dev/reference/apis/js-apis-treemap.md
+6
-6
en/application-dev/reference/apis/js-apis-treeset.md
en/application-dev/reference/apis/js-apis-treeset.md
+6
-6
en/application-dev/reference/apis/js-apis-util.md
en/application-dev/reference/apis/js-apis-util.md
+4
-4
en/application-dev/reference/apis/js-apis-vector.md
en/application-dev/reference/apis/js-apis-vector.md
+9
-9
en/application-dev/reference/apis/js-apis-xml.md
en/application-dev/reference/apis/js-apis-xml.md
+12
-0
未找到文件。
en/application-dev/reference/apis/js-apis-arraylist.md
浏览文件 @
87f5d0be
...
...
@@ -379,15 +379,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| arrlist | ArrayList
<
T
>
| No| Instance that
invokes the
**replaceAllElements**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| arrlist | ArrayList
<
T
>
| No| Instance that
calls the
**replaceAllElements**
API. The default value is this instance
.|
**Error codes**
...
...
@@ -425,15 +425,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| arrlist | ArrayList
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is 0.
|
| arrlist | ArrayList
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
@@ -468,7 +468,7 @@ Sorts elements in this container.
| 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
...
...
en/application-dev/reference/apis/js-apis-buffer.md
浏览文件 @
87f5d0be
...
...
@@ -204,7 +204,7 @@ Concatenates an array of **Buffer** instances of the specified length into a new
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| list | Buffer[]
\|
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**
...
...
@@ -1915,7 +1915,7 @@ Converts the data at the specified position in this **Buffer** instance into a s
| 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**
.|
| end | number | No| Offset to the end position of the data to convert. The default value is the length of this
**Buffer**
instance.|
...
...
en/application-dev/reference/apis/js-apis-deque.md
浏览文件 @
87f5d0be
...
...
@@ -242,15 +242,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| deque | Deque
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| deque | Deque
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-hashmap.md
浏览文件 @
87f5d0be
...
...
@@ -459,14 +459,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.|
| key | K | No| Key of the element that is currently traversed.|
| map | HashMap
<K
,
V
>
| No| Instance that
invokes the
**forEach**
method
.|
| 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.
The default value is the key of the first key-value pair.
|
| map | HashMap
<K
,
V
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-hashset.md
浏览文件 @
87f5d0be
...
...
@@ -282,14 +282,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.|
| key | T | No| Key of the element that is currently traversed (same as
**value**
).|
| set | HashSet
<
T
>
| No| Instance that
invokes the
**forEach**
API
.|
| 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**
).
The default value is the key of the first key-value pair.
|
| set | HashSet
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-lightweightmap.md
浏览文件 @
87f5d0be
...
...
@@ -724,14 +724,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.|
| key | K | No| Key of the element that is currently traversed.|
| map | LightWeightMap
<K
,
V
>
| No| Instance that
invokes the
**forEach**
method
.|
| 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.
The default value is the key of the first key-value pair.
|
| map | LightWeightMap
<K
,
V
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-lightweightset.md
浏览文件 @
87f5d0be
...
...
@@ -588,14 +588,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.|
| key| T | No| Key of the element that is currently traversed (same as
**value**
).|
| set | LightWeightSet
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| 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**
).
The default value is the key of the first key-value pair.
|
| set | LightWeightSet
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-linkedlist.md
浏览文件 @
87f5d0be
...
...
@@ -607,15 +607,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| LinkedList | LinkedList
<
T
>
| No| Instance that
invokes the
**forEach**
API
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| LinkedList | LinkedList
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-list.md
浏览文件 @
87f5d0be
...
...
@@ -427,15 +427,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| list | List
<
T
>
| No| Instance that
invokes the
**replaceAllElements**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| list | List
<
T
>
| No| Instance that
calls the
**replaceAllElements**
API. The default value is this instance
.|
**Error codes**
...
...
@@ -473,15 +473,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| List | List
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| List | List
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-plainarray.md
浏览文件 @
87f5d0be
...
...
@@ -597,14 +597,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No|
Key of the element that is currently traversed
.|
| PlainArray | PlainArray
<
T
>
| No| Instance that
invokes the
**forEach**
API
.|
| index | number | No|
Position index of the element that is currently traversed. The default value is
**0**
.|
| PlainArray | PlainArray
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-queue.md
浏览文件 @
87f5d0be
...
...
@@ -176,15 +176,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| Queue | Queue
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| Queue | Queue
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-stack.md
浏览文件 @
87f5d0be
...
...
@@ -214,15 +214,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| stack | Stack
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| stack | Stack
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-treemap.md
浏览文件 @
87f5d0be
...
...
@@ -48,7 +48,7 @@ A constructor used to create a **TreeMap** instance.
| 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**
...
...
@@ -611,14 +611,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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.
|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | No| Value of the element that is currently traversed.|
| key | K | No| Key of the element that is currently traversed.|
| map | TreeMap
<K
,
V
>
| No| Instance that
invokes the
**forEach**
method
.|
| 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.
The default value is the key of the first key-value pair.
|
| map | TreeMap
<K
,
V
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-treeset.md
浏览文件 @
87f5d0be
...
...
@@ -44,7 +44,7 @@ A constructor used to create a **TreeSet** instance.
| 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**
...
...
@@ -484,14 +484,14 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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.
|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | No| Value of the element that is currently traversed.|
| key | T | No| Key of the element that is currently traversed.|
| set | TreeSet
<
T
>
| No| Instance that
invokes the
**forEach**
method
.|
| 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.
The default value is the key of the first key-value pair.
|
| set | TreeSet
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Error codes**
...
...
en/application-dev/reference/apis/js-apis-util.md
浏览文件 @
87f5d0be
...
...
@@ -586,7 +586,7 @@ result = textEncoder.encodeInto("\uD800¥¥");
### 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.
...
...
@@ -617,7 +617,7 @@ result = that.encodeIntoUint8Array('abcd', dest)
### 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.
...
...
@@ -1100,7 +1100,7 @@ A constructor used to create a **LruCache** instance. The default capacity of th
| 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**
...
...
@@ -3400,7 +3400,7 @@ A constructor used to create a **LruBuffer** instance. The default capacity of t
| 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**
...
...
en/application-dev/reference/apis/js-apis-vector.md
浏览文件 @
87f5d0be
...
...
@@ -304,15 +304,15 @@ Replaces all elements in this container with new elements, and returns the new o
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| vector | Vector
<
T
>
| No| Instance that
invokes the
**replaceAllElements**
API
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| vector | Vector
<
T
>
| No| Instance that
calls the
**replaceAllElements**
API. The default value is this instance
.|
**Example**
...
...
@@ -342,15 +342,15 @@ Uses a callback to traverse the elements in this container and obtain their posi
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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
.|
callback
f
n
callback
F
n
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the element that is currently traversed.|
| index | number | No| Position index of the element that is currently traversed.|
| vector | Vector
<
T
>
| No| Instance that
invokes the
**forEach**
API
.|
| index | number | No| Position index of the element that is currently traversed.
The default value is
**0**
.
|
| vector | Vector
<
T
>
| No| Instance that
calls the
**forEach**
API. The default value is this instance
.|
**Example**
...
...
@@ -378,7 +378,7 @@ Sorts elements in this container.
| 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
...
...
en/application-dev/reference/apis/js-apis-xml.md
浏览文件 @
87f5d0be
...
...
@@ -381,6 +381,7 @@ Creates and returns an **XmlPullParser** object.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<!DOCTYPE note [
\n
<!ENTITY foo "baa">]>
'
+
...
...
@@ -432,6 +433,7 @@ Parses XML information.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -499,6 +501,7 @@ Obtains the column line number, starting from 1.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -542,6 +545,7 @@ Obtains the depth of this element.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -588,6 +592,7 @@ Obtains the current line number, starting from 1.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -631,6 +636,7 @@ Obtains the name of this element.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -673,6 +679,7 @@ Obtains the namespace of this element.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -715,6 +722,7 @@ Obtains the prefix of this element.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -758,6 +766,7 @@ Obtains the text of the current event.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -800,6 +809,7 @@ Checks whether the current element is empty.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -842,6 +852,7 @@ Checks whether the current text event contains only whitespace characters.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
@@ -883,6 +894,7 @@ Obtains the number of attributes for the current start tag.
**Example**
```
js
import
util
from
'
@ohos.util
'
;
let
strXml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
+
'
<note importance="high" logged="true">
'
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录