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