Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a1661cdd
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看板
未验证
提交
a1661cdd
编写于
9月 30, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
!10171 翻译完成:9816 modify containers and buffer for vod
Merge pull request !10171 from wusongqing/TR9816
上级
ca7e95d3
705ea2ed
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
309 addition
and
253 deletion
+309
-253
en/application-dev/reference/apis/js-apis-arraylist.md
en/application-dev/reference/apis/js-apis-arraylist.md
+10
-7
en/application-dev/reference/apis/js-apis-deque.md
en/application-dev/reference/apis/js-apis-deque.md
+8
-5
en/application-dev/reference/apis/js-apis-hashmap.md
en/application-dev/reference/apis/js-apis-hashmap.md
+32
-28
en/application-dev/reference/apis/js-apis-hashset.md
en/application-dev/reference/apis/js-apis-hashset.md
+31
-17
en/application-dev/reference/apis/js-apis-lightweightmap.md
en/application-dev/reference/apis/js-apis-lightweightmap.md
+47
-43
en/application-dev/reference/apis/js-apis-lightweightset.md
en/application-dev/reference/apis/js-apis-lightweightset.md
+37
-34
en/application-dev/reference/apis/js-apis-linkedlist.md
en/application-dev/reference/apis/js-apis-linkedlist.md
+8
-5
en/application-dev/reference/apis/js-apis-list.md
en/application-dev/reference/apis/js-apis-list.md
+9
-6
en/application-dev/reference/apis/js-apis-plainarray.md
en/application-dev/reference/apis/js-apis-plainarray.md
+34
-31
en/application-dev/reference/apis/js-apis-queue.md
en/application-dev/reference/apis/js-apis-queue.md
+5
-1
en/application-dev/reference/apis/js-apis-stack.md
en/application-dev/reference/apis/js-apis-stack.md
+4
-1
en/application-dev/reference/apis/js-apis-treemap.md
en/application-dev/reference/apis/js-apis-treemap.md
+43
-39
en/application-dev/reference/apis/js-apis-treeset.md
en/application-dev/reference/apis/js-apis-treeset.md
+34
-31
en/application-dev/reference/apis/js-apis-vector.md
en/application-dev/reference/apis/js-apis-vector.md
+7
-5
未找到文件。
en/application-dev/reference/apis/js-apis-arraylist.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,9 @@ When compared with **[LinkedList](js-apis-linkedlist.md)**, **ArrayList** is mor
**Recommended use case**
: Use
**ArrayList**
when elements in a container need to be frequently read.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -72,7 +75,7 @@ Adds an element at the end of this container.
let
result1
=
arrayList
.
add
(
1
);
let
b
=
[
1
,
2
,
3
];
let
result2
=
arrayList
.
add
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
arrayList
.
add
(
false
);
```
...
...
@@ -124,9 +127,9 @@ Checks whether this container has the specified element.
```
ts
let
arrayList
=
new
ArrayList
();
let
result
=
arrayList
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
arrayList
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result1
=
arrayList
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
arrayList
.
has
(
"
squirrel
"
);
arrayList
.
add
(
"
squirrel
"
);
let
result1
=
arrayList
.
has
(
"
squirrel
"
);
```
### getIndexOf
...
...
@@ -361,7 +364,7 @@ arrayList.add(4);
arrayList
.
add
(
5
);
arrayList
.
add
(
4
);
arrayList
.
forEach
((
value
,
index
)
=>
{
console
.
log
(
"
value:
"
+
value
,
index
);
console
.
log
(
`value:
${
value
}
`
,
index
);
});
```
...
...
@@ -623,14 +626,14 @@ arrayList.add(4);
// Method 1:
for
(
let
item
of
arrayList
)
{
console
.
log
(
"
value:
"
+
item
);
console
.
log
(
`value:
${
item
}
`
);
}
// Method 2:
let
iter
=
arrayList
[
Symbol
.
iterator
]();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
console
.
log
(
"
value:
"
+
temp
);
console
.
log
(
`value:
${
temp
}
`
);
temp
=
iter
.
next
().
value
;
}
```
en/application-dev/reference/apis/js-apis-deque.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,9 @@ Double-ended queue (deque) is a sequence container implemented based on the queu
**Recommended use case**
: Use
**Deque**
when you need to frequently insert or remove elements at both the ends of a container.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -64,7 +67,7 @@ deque.insertFront("a");
deque
.
insertFront
(
1
);
let
b
=
[
1
,
2
,
3
];
deque
.
insertFront
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
deque
.
insertFront
(
false
);
```
...
...
@@ -90,7 +93,7 @@ deque.insertEnd("a");
deque
.
insertEnd
(
1
);
let
b
=
[
1
,
2
,
3
];
deque
.
insertEnd
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
deque
.
insertEnd
(
false
);
```
...
...
@@ -118,9 +121,9 @@ Checks whether this container has the specified element.
```
ts
let
deque
=
new
Deque
();
let
result
=
deque
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
deque
.
insertFront
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result1
=
deque
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result
=
deque
.
has
(
"
squirrel
"
);
deque
.
insertFront
(
"
squirrel
"
);
let
result1
=
deque
.
has
(
"
squirrel
"
);
```
### popFirst
...
...
en/application-dev/reference/apis/js-apis-hashmap.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,10 @@
**Recommended use case**
: Use
**HashMap**
when you need to quickly access, remove, and insert key-value pairs.
This topic uses the following to identify the use of generics:
-
K: Key
-
V: Value
## Modules to Import
```
ts
...
...
@@ -90,9 +94,9 @@ Checks whether this container contains the specified key.
```
ts
let
hashMap
=
new
HashMap
();
let
result
=
hashMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
let
result1
=
hashMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
hashMap
.
hasKey
(
"
squirrel
"
);
hashMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
hashMap
.
hasKey
(
"
squirrel
"
);
```
...
...
@@ -121,7 +125,7 @@ Checks whether this container contains the specified value.
```
ts
let
hashMap
=
new
HashMap
();
let
result
=
hashMap
.
hasValue
(
123
);
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
hashMap
.
hasValue
(
123
);
```
...
...
@@ -150,9 +154,9 @@ Obtains the value of the specified key in this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
let
result
=
hashMap
.
get
(
"
s
dfs
"
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
hashMap
.
get
(
"
s
parrow
"
);
```
...
...
@@ -174,8 +178,8 @@ Adds all elements in a **HashMap** instance to this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
newHashMap
=
new
HashMap
();
hashMap
.
setAll
(
newHashMap
);
```
...
...
@@ -194,7 +198,7 @@ Adds an element to this container.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | K | Yes| Key of the target element.|
| value | V | Yes| Value of the element.|
| value | V | Yes| Value of the
target
element.|
**Return value**
...
...
@@ -206,7 +210,7 @@ Adds an element to this container.
```
ts
let
hashMap
=
new
HashMap
();
let
result
=
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
let
result
=
hashMap
.
set
(
"
squirrel
"
,
123
);
```
...
...
@@ -234,9 +238,9 @@ Removes an element with the specified key from this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
let
result
=
hashMap
.
remove
(
"
s
dfs
"
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
hashMap
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -252,8 +256,8 @@ Clears this container and sets its length to **0**.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
hashMap
.
clear
();
```
...
...
@@ -276,8 +280,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
hashMap
.
keys
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -305,8 +309,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
hashMap
.
values
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -341,8 +345,8 @@ Replaces an element in this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
s
dfs
"
,
123
);
let
result
=
hashMap
.
replace
(
"
s
dfs
"
,
357
);
hashMap
.
set
(
"
s
parrow
"
,
123
);
let
result
=
hashMap
.
replace
(
"
s
parrow
"
,
357
);
```
...
...
@@ -372,8 +376,8 @@ callbackfn
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
s
dfs
"
,
123
);
hashMap
.
set
(
"
dfsghsf
"
,
357
);
hashMap
.
set
(
"
s
parrow
"
,
123
);
hashMap
.
set
(
"
gull
"
,
357
);
hashMap
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
);
});
...
...
@@ -398,8 +402,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
hashMap
.
entries
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -427,8 +431,8 @@ Obtains an iterator, each item of which is a JavaScript object.
**Example**
```
ts
let
hashMap
=
new
HashMap
();
hashMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
hashMap
.
set
(
"
s
dfs
"
,
356
);
hashMap
.
set
(
"
squirrel
"
,
123
);
hashMap
.
set
(
"
s
parrow
"
,
356
);
// Method 1:
for
(
let
item
of
hashMap
)
{
...
...
en/application-dev/reference/apis/js-apis-hashset.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@ Unlike [TreeSet](js-apis-treeset.md), which stores and accesses data in sorted o
**Recommended use case**
: Use
**HashSet**
when you need a set that has only unique elements or need to deduplicate a set.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -26,6 +29,17 @@ import HashSet from '@ohos.util.HashSet';
| -------- | -------- | -------- | -------- | -------- |
| length | number | Yes| No| Number of elements in a hash set (called container later).|
**Example**
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
1
);
hashSet
.
add
(
2
);
hashSet
.
add
(
3
);
hashSet
.
add
(
4
);
hashSet
.
add
(
5
);
let
res
=
hashSet
.
length
;
```
### constructor
...
...
@@ -88,9 +102,9 @@ Checks whether this container contains the specified element.
```
ts
let
hashSet
=
new
HashSet
();
let
result
=
hashSet
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result1
=
hashSet
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
hashSet
.
has
(
"
squirrel
"
);
hashSet
.
add
(
"
squirrel
"
);
let
result1
=
hashSet
.
has
(
"
squirrel
"
);
```
...
...
@@ -118,7 +132,7 @@ Adds an element to this container.
```
ts
let
hashSet
=
new
HashSet
();
let
result
=
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
hashSet
.
add
(
"
squirrel
"
);
```
...
...
@@ -146,9 +160,9 @@ Removes an element from this container.
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
dfs
"
);
let
result
=
hashSet
.
remove
(
"
s
dfs
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
s
parrow
"
);
let
result
=
hashSet
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -164,8 +178,8 @@ Clears this container and sets its length to **0**.
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
dfs
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
s
parrow
"
);
hashSet
.
clear
();
```
...
...
@@ -188,8 +202,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
dfs
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
s
parrow
"
);
let
iter
=
hashSet
.
values
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -225,8 +239,8 @@ callbackfn
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
s
dfs
"
);
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
parrow
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
);
});
...
...
@@ -250,8 +264,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
dfs
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
s
parrow
"
);
let
iter
=
hashSet
.
entries
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -280,8 +294,8 @@ Obtains an iterator, each item of which is a JavaScript object.
```
ts
let
hashSet
=
new
HashSet
();
hashSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
hashSet
.
add
(
"
s
dfs
"
);
hashSet
.
add
(
"
squirrel
"
);
hashSet
.
add
(
"
s
parrow
"
);
// Method 1:
for
(
let
item
of
hashSet
)
{
...
...
en/application-dev/reference/apis/js-apis-lightweightmap.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,10 @@ Compared with **[HashMap](js-apis-hashmap.md)**, which can also store KV pairs,
**Recommended use case**
: Use LightWeightMap when you need to store and access
**KV pairs**
.
This topic uses the following to identify the use of generics:
-
K: Key
-
V: Value
## Modules to Import
```
ts
...
...
@@ -92,10 +96,10 @@ Checks whether this container contains all elements of the specified **LightWeig
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
map
=
new
LightWeightMap
();
map
.
set
(
"
s
dfs
"
,
356
);
map
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
hasAll
(
map
);
```
...
...
@@ -125,9 +129,9 @@ Checks whether this container contains the specified key.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
let
result
=
lightWeightMap
.
hasKey
;
lightWeightMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
let
result1
=
lightWeightMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightMap
.
hasKey
(
"
squirrel
"
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
lightWeightMap
.
hasKey
(
"
squirrel
"
);
```
...
...
@@ -156,7 +160,7 @@ Checks whether this container contains the specified value.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
let
result
=
lightWeightMap
.
hasValue
(
123
);
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
lightWeightMap
.
hasValue
(
123
);
```
...
...
@@ -207,9 +211,9 @@ Obtains the value of the specified key in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
let
result
=
lightWeightMap
.
get
(
"
s
dfs
"
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
get
(
"
s
parrow
"
);
```
...
...
@@ -237,9 +241,9 @@ Obtains the index of the first occurrence of an element with the specified key i
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
let
result
=
lightWeightMap
.
getIndexOfKey
(
"
s
dfs
"
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
getIndexOfKey
(
"
s
parrow
"
);
```
...
...
@@ -267,8 +271,8 @@ Obtains the index of the first occurrence of an element with the specified value
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
getIndexOfValue
(
123
);
```
...
...
@@ -297,8 +301,8 @@ Obtains the key of an element at the specified position in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
getKeyAt
(
1
);
```
...
...
@@ -321,8 +325,8 @@ Adds all elements in a **LightWeightMap** instance to this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
map
=
new
LightWeightMap
();
lightWeightMap
.
setAll
(
map
);
```
...
...
@@ -352,7 +356,7 @@ Adds an element to this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
let
result
=
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
let
result
=
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
```
...
...
@@ -380,9 +384,9 @@ Removes an element with the specified key from this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
remove
(
"
s
dfs
"
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
lightWeightMap
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -410,8 +414,8 @@ Removes an element at the specified position from this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
removeAt
(
1
);
```
...
...
@@ -441,8 +445,8 @@ Sets a value for an element at the specified position in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
lightWeightMap
.
setValueAt
(
1
,
3546
);
```
...
...
@@ -471,8 +475,8 @@ Obtains the value of an element at the specified position in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
lightWeightMap
.
getValueAt
(
1
);
```
...
...
@@ -489,8 +493,8 @@ Clears this container and sets its length to **0**.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
lightWeightMap
.
clear
();
```
...
...
@@ -513,8 +517,8 @@ Obtains an iterator that contains all the keys in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
lightWeightMap
.
keys
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -542,8 +546,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
lightWeightMap
.
values
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -579,8 +583,8 @@ callbackfn
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
s
dfs
"
,
123
);
lightWeightMap
.
set
(
"
dfsghsf
"
,
357
);
lightWeightMap
.
set
(
"
s
parrow
"
,
123
);
lightWeightMap
.
set
(
"
gull
"
,
357
);
lightWeightMap
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
);
});
...
...
@@ -605,8 +609,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
lightWeightMap
.
entries
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -634,8 +638,8 @@ Concatenates the elements in this container into a string and returns the string
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
A
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
lightWeightMap
.
toString
();
```
...
...
@@ -657,8 +661,8 @@ Obtains an iterator, each item of which is a JavaScript object.
```
ts
let
lightWeightMap
=
new
LightWeightMap
();
lightWeightMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
lightWeightMap
.
set
(
"
s
dfs
"
,
356
);
lightWeightMap
.
set
(
"
squirrel
"
,
123
);
lightWeightMap
.
set
(
"
s
parrow
"
,
356
);
// Method 1:
for
(
let
item
of
lightWeightMap
)
{
...
...
en/application-dev/reference/apis/js-apis-lightweightset.md
浏览文件 @
a1661cdd
...
...
@@ -14,6 +14,9 @@ Compared with **[HashSet](js-apis-hashset.md)**, which can also store values, **
**Recommended use case**
: Use
**LightWeightSet**
when you need a set that has only unique elements or need to deduplicate a set.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -93,7 +96,7 @@ Adds an element to this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
let
result
=
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
lightWeightSet
.
add
(
"
squirrel
"
);
```
...
...
@@ -115,10 +118,10 @@ Adds all elements in a **LightWeightSet** instance to this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
set
=
new
LightWeightSet
();
set
.
add
(
"
sfage
"
);
set
.
add
(
"
gull
"
);
let
result
=
lightWeightSet
.
addAll
(
set
);
```
...
...
@@ -147,10 +150,10 @@ Checks whether this container contains all elements of the specified **LightWeig
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
set
=
new
LightWeightSet
();
set
.
add
(
"
s
dfs
"
);
set
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
hasAll
(
set
);
```
...
...
@@ -209,9 +212,9 @@ Checks whether this container contains objects of the same type as the specified
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
let
obj
=
[
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
"
sdfs
"
];
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
obj
=
[
"
squirrel
"
,
"
sparrow
"
];
let
result
=
lightWeightSet
.
equal
(
obj
);
```
...
...
@@ -262,9 +265,9 @@ Obtains the position index of the element with the specified key in this contain
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
let
result
=
lightWeightSet
.
getIndexOf
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
getIndexOf
(
"
s
parrow
"
);
```
...
...
@@ -292,9 +295,9 @@ Removes an element of the specified key from this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
let
result
=
lightWeightSet
.
remove
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -322,8 +325,8 @@ Removes the element at the specified position from this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
removeAt
(
1
);
```
...
...
@@ -352,8 +355,8 @@ Obtains the value of the element at the specified position in this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
getValueAt
(
1
);
```
...
...
@@ -370,8 +373,8 @@ Clears this container and sets its length to **0**.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
lightWeightSet
.
clear
();
```
...
...
@@ -394,8 +397,8 @@ Obtains a string that contains all elements in this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
toString
();
```
...
...
@@ -418,8 +421,8 @@ Obtains an array that contains all objects in this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
result
=
lightWeightSet
.
toArray
();
```
...
...
@@ -442,8 +445,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
iter
=
lightWeightSet
.
values
();
let
index
=
0
;
while
(
index
<
lightWeightSet
.
length
)
{
...
...
@@ -479,8 +482,8 @@ callbackfn
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
dfsghsf
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
lightWeightSet
.
add
(
"
gull
"
);
lightWeightSet
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
);
});
...
...
@@ -505,8 +508,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
let
iter
=
lightWeightSet
.
entries
();
let
index
=
0
;
while
(
index
<
lightWeightSet
.
length
)
{
...
...
@@ -534,8 +537,8 @@ Obtains an iterator, each item of which is a JavaScript object.
```
ts
let
lightWeightSet
=
new
LightWeightSet
();
lightWeightSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
lightWeightSet
.
add
(
"
s
dfs
"
);
lightWeightSet
.
add
(
"
squirrel
"
);
lightWeightSet
.
add
(
"
s
parrow
"
);
// Method 1:
for
(
let
item
of
lightWeightSet
)
{
...
...
en/application-dev/reference/apis/js-apis-linkedlist.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,9 @@ Unlike **[List](js-apis-list.md)**, which is a singly linked list, **LinkedList*
**Recommended use case**
: Use
**LinkedList**
for frequent insertion and removal operations.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -76,7 +79,7 @@ let result = linkedList.add("a");
let
result1
=
linkedList
.
add
(
1
);
let
b
=
[
1
,
2
,
3
];
linkedList
.
add
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
linkedList
.
add
(
false
);
```
...
...
@@ -102,7 +105,7 @@ linkedList.addFirst("a");
linkedList
.
addFirst
(
1
);
let
b
=
[
1
,
2
,
3
];
linkedList
.
addFirst
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
linkedList
.
addFirst
(
false
);
```
...
...
@@ -154,9 +157,9 @@ Checks whether this container has the specified element.
```
ts
let
linkedList
=
new
LinkedList
();
let
result1
=
linkedList
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
linkedList
.
add
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result
=
linkedList
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result1
=
linkedList
.
has
(
"
squirrel
"
);
linkedList
.
add
(
"
squirrel
"
);
let
result
=
linkedList
.
has
(
"
squirrel
"
);
```
### get
...
...
en/application-dev/reference/apis/js-apis-list.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@ Unlike [LinkedList](js-apis-linkedlist.md), which is a doubly linked list, **Lis
**Recommended use case**
: Use
**List**
for frequent insertion and removal operations.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -72,7 +75,7 @@ let result = list.add("a");
let
result1
=
list
.
add
(
1
);
let
b
=
[
1
,
2
,
3
];
list
.
add
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
list
.
add
(
false
);
```
...
...
@@ -124,9 +127,9 @@ Checks whether this container has the specified element.
```
ts
let
list
=
new
List
();
let
result
=
list
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
list
.
add
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result1
=
list
.
has
(
"
Ahfbrgrbgnutfodgorrogorg
"
);
let
result
=
list
.
has
(
"
squirrel
"
);
list
.
add
(
"
squirrel
"
);
let
result1
=
list
.
has
(
"
squirrel
"
);
```
### get
...
...
@@ -181,7 +184,7 @@ Obtains the index of the last occurrence of the specified element in this contai
| Value Type | Description|
| -------- | -------- |
| number | Returns the
position
index if obtained; returns
**-1**
otherwise.|
| number | Returns the index if obtained; returns
**-1**
otherwise.|
**Example**
...
...
@@ -265,7 +268,7 @@ obj1.add(2);
obj1
.
add
(
4
);
obj1
.
add
(
5
);
list
.
equal
(
obj1
);
let
obj2
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
obj2
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result
=
list
.
equal
(
obj2
);
```
...
...
en/application-dev/reference/apis/js-apis-plainarray.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,9 @@ Both **PlainArray** and **[LightWeightMap](js-apis-lightweightmap.md)** are used
**Recommended use case**
: Use
**PlainArray**
when you need to store KV pairs whose keys are of the
**number**
type.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -93,7 +96,7 @@ Checks whether this container contains the specified key.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
has
(
1
);
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
let
result1
=
plainArray
.
has
(
1
);
```
...
...
@@ -122,8 +125,8 @@ Obtains the value of the specified key in this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
get
(
1
);
```
...
...
@@ -152,8 +155,8 @@ Obtains the index of the first occurrence of an element with the specified key i
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
getIndexOfKey
(
2
);
```
...
...
@@ -182,9 +185,9 @@ Obtains the index of the first occurrence of an element with the specified value
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
let
result
=
plainArray
.
getIndexOfValue
(
"
s
ddfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
getIndexOfValue
(
"
s
quirrel
"
);
```
...
...
@@ -212,8 +215,8 @@ Obtains the key of the element at the specified position in this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
getKeyAt
(
1
);
```
...
...
@@ -241,8 +244,8 @@ Obtains the value of an element at the specified position in this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
getKeyAt
(
1
);
```
...
...
@@ -264,8 +267,8 @@ Clones this container and returns a copy. The modification to the copy does not
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
newPlainArray
=
plainArray
.
clone
();
```
...
...
@@ -289,7 +292,7 @@ Adds an element to this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
```
...
...
@@ -317,8 +320,8 @@ Removes an element with the specified key from this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
plainArray
.
remove
(
2
);
let
result
=
plainArray
.
remove
(
2
);
```
...
...
@@ -348,8 +351,8 @@ Removes an element at the specified position from this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
plainArray
.
removeAt
(
1
);
let
result
=
plainArray
.
removeAt
(
1
);
```
...
...
@@ -380,8 +383,8 @@ Removes elements in a specified range from this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
removeRangeFrom
(
1
,
3
);
```
...
...
@@ -405,8 +408,8 @@ Sets a value for an element at the specified position in this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
plainArray
.
setValueAt
(
1
,
3546
);
```
...
...
@@ -429,8 +432,8 @@ Obtains a string that contains all elements in this container.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
let
result
=
plainArray
.
toString
();
```
...
...
@@ -447,8 +450,8 @@ Clears this container and sets its length to **0**.
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
plainArray
.
clear
();
```
...
...
@@ -479,8 +482,8 @@ callbackfn
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
plainArray
.
forEach
((
value
,
index
)
=>
{
console
.
log
(
"
value:
"
+
value
,
index
);
});
...
...
@@ -505,8 +508,8 @@ Obtains an iterator object that contains key-value pairs, where the key is of th
```
ts
let
plainArray
=
new
PlainArray
();
plainArray
.
add
(
1
,
"
s
ddfhf
"
);
plainArray
.
add
(
2
,
"
s
ffdfhf
"
);
plainArray
.
add
(
1
,
"
s
quirrel
"
);
plainArray
.
add
(
2
,
"
s
parrow
"
);
// Method 1:
for
(
let
item
of
plainArray
)
{
...
...
en/application-dev/reference/apis/js-apis-queue.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@ Unlike **[Deque](js-apis-deque.md)**, which supports insertion and removal at bo
**Recommended use case**
: Use
**Queue**
in FIFO scenarios.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -72,7 +75,7 @@ let result1 = queue.add(1);
queue
.
add
(
1
);
let
b
=
[
1
,
2
,
3
];
queue
.
add
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
queue
.
add
(
c
);
```
...
...
@@ -180,6 +183,7 @@ Obtains an iterator, each item of which is a JavaScript object.
| IterableIterator
<
T
>
| Iterator obtained.|
**Example**
```
ts
let
queue
=
new
Queue
();
queue
.
add
(
2
);
...
...
en/application-dev/reference/apis/js-apis-stack.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@ Unlike **[Queue](js-apis-queue.md)**, which is implemented based on the queue da
**Recommended use case**
: Use
**Stack**
in LOFI scenarios.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -73,7 +76,7 @@ let result = stack.push("a");
let
result1
=
stack
.
push
(
1
);
let
b
=
[
1
,
2
,
3
];
stack
.
push
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
stack
.
push
(
c
);
```
...
...
en/application-dev/reference/apis/js-apis-treemap.md
浏览文件 @
a1661cdd
...
...
@@ -12,6 +12,10 @@
Recommended use case: Use
**TreeMap**
when you need to store KV pairs in sorted order.
This topic uses the following to identify the use of generics:
-
K: Key
-
V: Value
## Modules to Import
```
ts
...
...
@@ -96,9 +100,9 @@ Checks whether this container has the specified key.
```
ts
let
treeMap
=
new
TreeMap
();
let
result
=
treeMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
let
result1
=
treeMap
.
hasKey
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
treeMap
.
hasKey
(
"
squirrel
"
);
treeMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
treeMap
.
hasKey
(
"
squirrel
"
);
```
...
...
@@ -127,7 +131,7 @@ Checks whether this container has the specified value.
```
ts
let
treeMap
=
new
TreeMap
();
let
result
=
treeMap
.
hasValue
(
123
);
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
squirrel
"
,
123
);
let
result1
=
treeMap
.
hasValue
(
123
);
```
...
...
@@ -156,9 +160,9 @@ Obtains the value of the specified key in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
let
result
=
treeMap
.
get
(
"
s
dfs
"
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
treeMap
.
get
(
"
s
parrow
"
);
```
...
...
@@ -180,8 +184,8 @@ Obtains the first key in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
treeMap
.
getFirstKey
();
```
...
...
@@ -204,8 +208,8 @@ Obtains the last key in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
result
=
treeMap
.
getLastKey
();
```
...
...
@@ -228,8 +232,8 @@ Adds all elements in a **TreeMap** instance to this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
map
=
new
TreeMap
();
treeMap
.
setAll
(
map
);
```
...
...
@@ -260,7 +264,7 @@ Adds an element to this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
squirrel
"
,
123
);
```
...
...
@@ -288,9 +292,9 @@ Removes the element with the specified key from this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
remove
(
"
s
dfs
"
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
treeMap
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -318,10 +322,10 @@ Obtains the key that is placed in front of the input key in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
zdfgsd
"
,
356
);
let
result
=
treeMap
.
getLowerKey
(
"
s
dfs
"
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
treeMap
.
set
(
"
gander
"
,
356
);
let
result
=
treeMap
.
getLowerKey
(
"
s
parrow
"
);
```
...
...
@@ -349,10 +353,10 @@ Obtains the key that is placed next to the input key in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
zdfgsd
"
,
356
);
let
result
=
treeMap
.
getHigherKey
(
"
s
dfs
"
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
treeMap
.
set
(
"
gander
"
,
356
);
let
result
=
treeMap
.
getHigherKey
(
"
s
parrow
"
);
```
### replace
...
...
@@ -380,8 +384,8 @@ Replaces an element in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
s
dfs
"
,
123
);
let
result
=
treeMap
.
replace
(
"
s
dfs
"
,
357
);
treeMap
.
set
(
"
s
parrow
"
,
123
);
let
result
=
treeMap
.
replace
(
"
s
parrow
"
,
357
);
```
...
...
@@ -397,8 +401,8 @@ Clears this container and sets its length to **0**.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
treeMap
.
clear
();
```
...
...
@@ -421,8 +425,8 @@ Obtains an iterator that contains all the keys in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
treeMap
.
keys
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -450,8 +454,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
treeMap
.
values
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -487,8 +491,8 @@ callbackfn
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
s
dfs
"
,
123
);
treeMap
.
set
(
"
dfsghsf
"
,
357
);
treeMap
.
set
(
"
s
parrow
"
,
123
);
treeMap
.
set
(
"
gull
"
,
357
);
treeMap
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
);
});
...
...
@@ -513,8 +517,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
let
iter
=
treeMap
.
entries
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -542,8 +546,8 @@ Obtains an iterator, each item of which is a JavaScript object.
```
ts
let
treeMap
=
new
TreeMap
();
treeMap
.
set
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
,
123
);
treeMap
.
set
(
"
s
dfs
"
,
356
);
treeMap
.
set
(
"
squirrel
"
,
123
);
treeMap
.
set
(
"
s
parrow
"
,
356
);
// Method 1:
for
(
let
item
of
treeMap
)
{
...
...
en/application-dev/reference/apis/js-apis-treeset.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@
Recommended use case: Use
**TreeSet**
when you need to store data in sorted order.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -29,7 +32,7 @@ import TreeSet from '@ohos.util.TreeSet';
### constructor
constructor(comparator?:(firstValue: T, secondValue: T) => boolean)
constructor(comparator?:
(firstValue: T, secondValue: T) => boolean)
A constructor used to create a
**TreeSet**
instance.
...
...
@@ -118,8 +121,8 @@ Obtains the value of the first element in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
result
=
treeSet
.
getFirstValue
();
```
...
...
@@ -142,8 +145,8 @@ Obtains the value of the last element in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
result
=
treeSet
.
getLastValue
();
```
...
...
@@ -172,7 +175,7 @@ Adds an element to this container.
```
ts
let
treeSet
=
new
TreeSet
();
let
result
=
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
treeSet
.
add
(
"
squirrel
"
);
```
...
...
@@ -200,9 +203,9 @@ Removes the element with the specified key from this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
let
result
=
treeSet
.
remove
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
result
=
treeSet
.
remove
(
"
s
parrow
"
);
```
...
...
@@ -230,10 +233,10 @@ Obtains the value that is placed in front of the input key in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
zdfgsd
"
);
let
result
=
treeSet
.
getLowerValue
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
treeSet
.
add
(
"
gander
"
);
let
result
=
treeSet
.
getLowerValue
(
"
s
parrow
"
);
```
...
...
@@ -261,10 +264,10 @@ Obtains the value that is placed next to the input key in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
zdfgsd
"
);
let
result
=
treeSet
.
getHigherValue
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
treeSet
.
add
(
"
gander
"
);
let
result
=
treeSet
.
getHigherValue
(
"
s
parrow
"
);
```
...
...
@@ -286,8 +289,8 @@ Removes the first element in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
result
=
treeSet
.
popFirst
();
```
...
...
@@ -310,8 +313,8 @@ Removes the last element in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
result
=
treeSet
.
popLast
();
```
...
...
@@ -328,8 +331,8 @@ Clears this container and sets its length to **0**.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
treeSet
.
clear
();
```
...
...
@@ -352,8 +355,8 @@ Obtains an iterator that contains all the values in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
iter
=
treeSet
.
values
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -389,8 +392,8 @@ callbackfn
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
dfsghsf
"
);
treeSet
.
add
(
"
s
parrow
"
);
treeSet
.
add
(
"
gull
"
);
treeSet
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
value:
"
+
value
,
key
)
});
...
...
@@ -415,8 +418,8 @@ Obtains an iterator that contains all the elements in this container.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
let
iter
=
treeSet
.
entries
();
let
temp
=
iter
.
next
().
value
;
while
(
temp
!=
undefined
)
{
...
...
@@ -445,8 +448,8 @@ Obtains an iterator, each item of which is a JavaScript object.
```
ts
let
treeSet
=
new
TreeSet
();
treeSet
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
treeSet
.
add
(
"
s
dfs
"
);
treeSet
.
add
(
"
squirrel
"
);
treeSet
.
add
(
"
s
parrow
"
);
// Method 1:
for
(
let
item
of
treeSet
)
{
...
...
en/application-dev/reference/apis/js-apis-vector.md
浏览文件 @
a1661cdd
...
...
@@ -10,6 +10,9 @@ Both **Vector** and **[ArrayList](js-apis-arraylist.md)** are implemented based
**Recommended use case**
: Use
**Vector**
when the data volume is large.
This topic uses the following to identify the use of generics:
-
T: Type
## Modules to Import
```
ts
...
...
@@ -71,7 +74,7 @@ let result = vector.add("a");
let
result1
=
vector
.
add
(
1
);
let
b
=
[
1
,
2
,
3
];
vector
.
add
(
b
);
let
c
=
{
name
:
"
lala
"
,
age
:
"
13
"
};
let
c
=
{
name
:
"
Dylon
"
,
age
:
"
13
"
};
let
result3
=
vector
.
add
(
c
);
```
...
...
@@ -123,9 +126,9 @@ Checks whether this container has the specified element.
```
ts
let
vector
=
new
Vector
();
let
result
=
vector
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
vector
.
add
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result1
=
vector
.
has
(
"
Ahfbrgrbgnutfodgorrogorgrogofdfdf
"
);
let
result
=
vector
.
has
(
"
squirrel
"
);
vector
.
add
(
"
squirrel
"
);
let
result1
=
vector
.
has
(
"
squirrel
"
);
```
### getIndexOf
...
...
@@ -862,7 +865,6 @@ Obtains an iterator. Each item of the iterator is a JavaScript object.
**System capability**
: SystemCapability.Utils.Lang
**Return value**
| Type| Description|
| -------- | -------- |
| IterableIterator
<
T
>
| Iterator obtained.|
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录