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

!2677 Done! 2370:Correct incorrect display format

Merge pull request !2677 from wusongqing/TR2370
......@@ -333,8 +333,8 @@ Uses a callback to traverse the entries in this container and obtain their posit
callbackfn
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | Yes| Value of the entry that is currently traversed.|
| key | K | Yes| Key of the entry that is currently traversed.|
| value | V | No| Value of the entry that is currently traversed.|
| key | K | No| Key of the entry that is currently traversed.|
| map | HashMap<K, V> | No| Instance that invokes the **forEach** method.|
**Example**
......@@ -351,7 +351,7 @@ hashMap.forEach((value, key) => {
### entries
entries(): IterableIterator<[K, V]>
entries(): IterableIterator&lt;[K, V]&gt;
Obtains an iterator that contains all the entries in this container.
......@@ -359,7 +359,7 @@ Obtains an iterator that contains all the entries in this container.
| Type| Description|
| -------- | -------- |
| IterableIterator<[K, V]> | Iterator obtained.|
| IterableIterator&lt;[K, V]&gt; | Iterator obtained.|
**Example**
......@@ -387,7 +387,7 @@ Obtains an iterator, each item of which is a JavaScript object.
| Type| Description|
| -------- | -------- |
| IterableIterator<[K, V]> | Iterator obtained.|
| IterableIterator&lt;[K, V]&gt; | Iterator obtained.|
**Example**
```
......
......@@ -60,7 +60,7 @@ Adds an entry at the end of this container.
**Example**
```
let list = new List;
let list = new List();
let result = list.add("a");
let result1 = list.add(1);
let b = [1, 2, 3];
......@@ -160,7 +160,7 @@ Obtains the index of the last occurrence of the specified entry in this containe
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| element | T | Yes| Entry to query.|
| element | T | Yes| Entry to obtain.|
**Return value**
......@@ -192,7 +192,7 @@ Obtains the index of the first occurrence of the specified entry in this contain
| Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| element | T | Yes| Entry to query.|
| element | T | Yes| Entry to obtain.|
**Return value**
......@@ -310,6 +310,7 @@ let result = list.remove(2);
```
### replaceAllElements
replaceAllElements(callbackfn: (value: T, index?: number, list?: List&lt;T&gt;) => T,
thisArg?: Object): void
......@@ -347,6 +348,7 @@ list.replaceAllElements((value, index) => {
```
### forEach
forEach(callbackfn: (value: T, index?: number, List?: List&lt;T&gt;) => void,
thisArg?: Object): void
......@@ -382,6 +384,7 @@ list.forEach((value, index) => {
```
### sort
sort(comparator: (firstValue: T, secondValue: T) => number): void
Sorts entries in this container.
......@@ -412,6 +415,7 @@ list.sort(a, (b => b - a));
```
### getSubList
getSubList(fromIndex: number, toIndex: number): List&lt;T&gt;
Obtains entries within a range in this container, including the entry at the start position but not that at the end position, and returns these entries as a new **List** instance.
......@@ -443,6 +447,7 @@ let result2 = list.subList(2, 6);
```
### clear
clear(): void
Clears this container and sets its length to **0**.
......@@ -459,6 +464,7 @@ list.clear();
```
### set
set(index: number, element: T): T
Replaces an entry at the specified position in this container with a given entry.
......@@ -489,6 +495,7 @@ list.set(2, "b");
```
### convertToArray
convertToArray(): Array&lt;T&gt;
Converts this container into an array.
......@@ -511,6 +518,7 @@ let result = list.convertToArray();
```
### isEmpty
isEmpty(): boolean
Checks whether this container is empty (contains no entry).
......@@ -547,7 +555,7 @@ Obtains the first entry in this container.
**Example**
```
let list = new Vector();
let list = new List();
list.add(2);
list.add(4);
list.add(5);
......@@ -570,7 +578,7 @@ Obtains the last entry in this container.
**Example**
```
let list = new Vector();
let list = new List();
list.add(2);
list.add(4);
list.add(5);
......@@ -580,7 +588,7 @@ let result = list.getLast();
### [Symbol.iterator]
[Symbol.iterator]\(): IterableIterator&lt;T&gt;;
[Symbol.iterator]\(): IterableIterator&lt;T&gt;
Obtains an iterator, each item of which is a JavaScript object.
......
......@@ -115,7 +115,7 @@ let result = plainArray.get(1);
### getIndexOfKey
getIndexOfKey(key: number): number;
getIndexOfKey(key: number): number
Obtains the index of the first occurrence of an entry with the specified key in this container.
......@@ -143,7 +143,7 @@ let result = plainArray.getIndexOfKey("sdfs");
### getIndexOfValue
getIndexOfValue(value: T): number;
getIndexOfValue(value: T): number
Obtains the index of the first occurrence of an entry with the specified value in this container.
......@@ -171,7 +171,7 @@ let result = plainArray.getIndexOfValue("sddfhf");
### getKeyAt
getKeyAt(index: number): number;
getKeyAt(index: number): number
Obtains the key of the entry at the specified position in this container.
......@@ -238,7 +238,7 @@ Clones this container and returns a copy. The modification to the copy does not
**Example**
```
let plainArray = new ArrayList();
let plainArray = new PlainArray();
plainArray.add(1, "sddfhf");
plainArray.add(2, "sffdfhf");
let newPlainArray = plainArray.clone();
......@@ -416,7 +416,7 @@ plainArray.clear();
### forEach
forEach(callbackfn: (value?: T, index?: number, PlainArray?: PlainArray<T>) => void, thisArg?: Object): void
forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray&lt;T&gt;) => void, thisArg?: Object): void
Uses a callback to traverse the entries in this container and obtain their position indexes.
......@@ -431,8 +431,8 @@ callbackfn
| Name| Type | Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the entry that is currently traversed.|
| index | number | Yes| Key of the entry that is currently traversed.|
| plainArray | PlainArray<T> | No| Instance that invokes the **forEach** API.|
| index | number | No| Key of the entry that is currently traversed.|
| PlainArray | PlainArray&lt;T&gt;| No| Instance that invokes the **forEach** API.|
**Example**
......@@ -456,7 +456,7 @@ Obtains an iterator, each item of which is a JavaScript object.
| Type| Description|
| -------- | -------- |
| IterableIterator<[number, T]> | Iterator obtained.|
| IterableIterator&lt;[number, T]&gt; | Iterator obtained.|
**Example**
......
......@@ -45,7 +45,7 @@ let treeMap = new TreeMap();
### isEmpty
isEmpty(): boolean;
isEmpty(): boolean
Checks whether this container is empty (contains no entry).
......@@ -65,7 +65,7 @@ let result = treeMap.isEmpty();
### hasKey
hasKey(key: K): boolean;
hasKey(key: K): boolean
Checks whether this container has the specified key.
......@@ -73,7 +73,7 @@ Checks whether this container has the specified key.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| key | K | Yes| Key to query.|
| key | K | Yes| Key to check.|
**Return value**
......@@ -101,7 +101,7 @@ Checks whether this container has the specified value.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | Yes| Value to query.|
| value | V | Yes| Value to check.|
**Return value**
......@@ -149,7 +149,7 @@ let result = treeMap.get("sdfs");
### getFirstKey
getFirstKey(): K;
getFirstKey(): K
Obtains the first key in this container.
......@@ -171,7 +171,7 @@ let result = treeMap.getFirstKey();
### getLastKey
getLastKey(): K;
getLastKey(): K
Obtains the last key in this container.
......@@ -215,6 +215,7 @@ treeMap.setAll(map);
### set
set(key: K, value: V): Object
Adds an entry to this container.
......@@ -242,7 +243,7 @@ treeMap.set("Ahfbrgrbgnutfodgorrogorgrogofdfdf", 123);
### remove
remove(key: K): V;
remove(key: K): V
Removes the entry with the specified key from this container.
......@@ -326,6 +327,7 @@ let result = treeMap.getHigherKey("sdfs");
```
### replace
replace(key: K, newValue: V): boolean
Replaces an entry in this container.
......@@ -424,7 +426,7 @@ while(temp != undefined) {
### forEach
forEach(callbackfn: (value: V, key?: K, map?: TreeMap<K, V>) => void, thisArg?: Object): void
forEach(callbackfn: (value?: V, key?: K, map?: TreeMap<K, V>) => void, thisArg?: Object): void
Uses a callback to traverse the entries in this container and obtain their position indexes.
......@@ -438,8 +440,8 @@ Uses a callback to traverse the entries in this container and obtain their posit
callbackfn
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | V | Yes| Value of the entry that is currently traversed.|
| key | K | Yes| Key of the entry that is currently traversed.|
| value | V | No| Value of the entry that is currently traversed.|
| key | K | No| Key of the entry that is currently traversed.|
| map | TreeMap<K, V> | No| Instance that invokes the **forEach** method.|
**Example**
......@@ -484,7 +486,7 @@ while(temp != undefined) {
### [Symbol.iterator]
[Symbol.iterator]\(): IterableIterator&lt;[K, V]&gt;;
[Symbol.iterator]\(): IterableIterator&lt;[K, V]&gt;
Obtains an iterator, each item of which is a JavaScript object.
......
......@@ -136,6 +136,7 @@ let result = treeSet.getLastValue();
### add
add(value: T): boolean
Adds an entry to this container.
......@@ -162,7 +163,7 @@ let result = treeSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf");
### remove
remove(value: T): boolean;
remove(value: T): boolean
Removes the entry with the specified key from this container.
......@@ -335,7 +336,7 @@ while(temp != undefined) {
### forEach
forEach(callbackfn: (value: T, key?: T, set?: TreeSet&lt;T&gt;) => void, thisArg?: Object): void
forEach(callbackfn: (value?: T, key?: T, set?: TreeSet&lt;T&gt;) => void, thisArg?: Object): void
Uses a callback to traverse the entries in this container and obtain their position indexes.
......@@ -349,7 +350,7 @@ Uses a callback to traverse the entries in this container and obtain their posit
callbackfn
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| value | T | Yes| Value of the entry that is currently traversed.|
| value | T | No| Value of the entry that is currently traversed.|
| key | T | No| Key of the entry that is currently traversed (same as **value**).|
| set | TreeSet&lt;T&gt; | No| Instance that invokes the **forEach** method.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册