diff --git a/en/application-dev/reference/apis/js-apis-hashmap.md b/en/application-dev/reference/apis/js-apis-hashmap.md index 0e5074650a58f11ca81e4a50580a02df48ab0fe1..612f81c27952b106218a84edb569c09a23203863 100644 --- a/en/application-dev/reference/apis/js-apis-hashmap.md +++ b/en/application-dev/reference/apis/js-apis-hashmap.md @@ -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 | No| Instance that invokes the **forEach** method.| **Example** @@ -351,7 +351,7 @@ hashMap.forEach((value, key) => { ### entries -entries(): IterableIterator<[K, V]> +entries(): IterableIterator<[K, V]> 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<[K, V]> | 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<[K, V]> | Iterator obtained.| **Example** ``` diff --git a/en/application-dev/reference/apis/js-apis-list.md b/en/application-dev/reference/apis/js-apis-list.md index 7c39d49ce7febeb2c27fcd532f993ea4ec2e5d37..ad87462656501d54e206b824c51b5555ec8b3e67 100644 --- a/en/application-dev/reference/apis/js-apis-list.md +++ b/en/application-dev/reference/apis/js-apis-list.md @@ -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<T>) => T, thisArg?: Object): void @@ -347,6 +348,7 @@ list.replaceAllElements((value, index) => { ``` ### forEach + forEach(callbackfn: (value: T, index?: number, List?: List<T>) => 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<T> 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<T> 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<T>; +[Symbol.iterator]\(): IterableIterator<T> Obtains an iterator, each item of which is a JavaScript object. diff --git a/en/application-dev/reference/apis/js-apis-plainarray.md b/en/application-dev/reference/apis/js-apis-plainarray.md index 5e847795d004d2fabb0acdf3fc28d7231b0cc9a2..ad79f05458fa5426b6cef9f0ab2e459726e030ed 100644 --- a/en/application-dev/reference/apis/js-apis-plainarray.md +++ b/en/application-dev/reference/apis/js-apis-plainarray.md @@ -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) => void, thisArg?: Object): void +forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray<T>) => 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 | No| Instance that invokes the **forEach** API.| +| index | number | No| Key of the entry that is currently traversed.| +| PlainArray | PlainArray<T>| 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<[number, T]> | Iterator obtained.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-treemap.md b/en/application-dev/reference/apis/js-apis-treemap.md index 047a66fbf44e97d3c45ac04d04ba5be64b629fd1..8aa15caf96fdf5886027bfae520473081cedef87 100644 --- a/en/application-dev/reference/apis/js-apis-treemap.md +++ b/en/application-dev/reference/apis/js-apis-treemap.md @@ -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) => void, thisArg?: Object): void +forEach(callbackfn: (value?: V, key?: K, map?: TreeMap) => 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 | No| Instance that invokes the **forEach** method.| **Example** @@ -484,7 +486,7 @@ while(temp != undefined) { ### [Symbol.iterator] -[Symbol.iterator]\(): IterableIterator<[K, V]>; +[Symbol.iterator]\(): IterableIterator<[K, V]> Obtains an iterator, each item of which is a JavaScript object. diff --git a/en/application-dev/reference/apis/js-apis-treeset.md b/en/application-dev/reference/apis/js-apis-treeset.md index bc937047ab2edb71d6c27322ba93f785632e9079..a37b5515c9aed096bb708c40eb2482acf35311d0 100644 --- a/en/application-dev/reference/apis/js-apis-treeset.md +++ b/en/application-dev/reference/apis/js-apis-treeset.md @@ -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<T>) => void, thisArg?: Object): void +forEach(callbackfn: (value?: T, key?: T, set?: TreeSet<T>) => 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<T> | No| Instance that invokes the **forEach** method.|