diff --git a/zh-cn/application-dev/reference/apis/js-apis-arraylist.md b/zh-cn/application-dev/reference/apis/js-apis-arraylist.md index 7435c4bd4aad33fb8e261a1a7b3368e94091a011..cacdffa0928cc681600613b68c7a8f0ca71c6bd0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-arraylist.md +++ b/zh-cn/application-dev/reference/apis/js-apis-arraylist.md @@ -264,6 +264,7 @@ arrayList.removeByRange(2, 6); ``` ### replaceAllElements + replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList<T>) => T, thisArg?: Object): void @@ -301,6 +302,7 @@ arrayList.replaceAllElements((value, index) => { ``` ### forEach + forEach(callbackfn: (value: T, index?: number, arrlist?: ArrayList<T>) => void, thisArg?: Object): void @@ -335,6 +337,7 @@ arrayList.forEach((value, index) => { ``` ### sort + sort(comparator?: (firstValue: T, secondValue: T) => number): void 对ArrayList中的元素排序。 @@ -366,6 +369,7 @@ arrayList.sort(); ``` ### subArrayList + subArrayList(fromIndex: number, toIndex: number): ArrayList<T> 根据下标截取ArrayList中的一段元素,并返回这一段ArrayList实例,包括起始值但不包括终止值。 @@ -397,6 +401,7 @@ let result3 = arrayList.subArrayList(2, 6); ``` ### clear + clear(): void 清除ArrayList中的所有元素,并把length置为0。 @@ -413,6 +418,7 @@ arrayList.clear(); ``` ### clone + clone(): ArrayList<T> 克隆一个与ArrayList相同的实例,并返回克隆后的实例。修改克隆后的实例并不会影响原实例。 @@ -436,6 +442,7 @@ let result = arrayList.clone(); ``` ### getCapacity + getCapacity(): number 获取当前实例的容量大小。 @@ -458,6 +465,7 @@ let result = arrayList.getCapacity(); ``` ### convertToArray + convertToArray(): Array<T> 把当前ArrayList实例转换成数组,并返回转换后的数组。 @@ -480,6 +488,7 @@ let result = arrayList.convertToArray(); ``` ### isEmpty + isEmpty(): boolean 判断该ArrayList是否为空。 @@ -502,6 +511,7 @@ let result = arrayList.isEmpty(); ``` ### increaseCapacityTo + increaseCapacityTo(newCapacity: number): void 如果传入的新容量大于或等于ArrayList中的元素个数,将容量变更为新容量。 @@ -525,6 +535,7 @@ arrayList.increaseCapacityTo(8); ``` ### trimToCurrentLength + trimToCurrentLength(): void 把容量限制为当前的length大小。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-deque.md b/zh-cn/application-dev/reference/apis/js-apis-deque.md index 7ad3b930f97b8503ac886f41e4c08cba42b9c759..9d51cccda6d334f75258076f387ace1403cce6f5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deque.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deque.md @@ -158,6 +158,7 @@ let result = deque.popLast(); ``` ### forEach + forEach(callbackfn: (value: T, index?: number, deque?: Deque<T>) => void, thisArg?: Object): void @@ -193,7 +194,7 @@ deque.forEach((value, index) => { ### getFirst -getFirst(): T; +getFirst(): T 获取Deque实例中的头元素。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-hashmap.md b/zh-cn/application-dev/reference/apis/js-apis-hashmap.md index 7e2dfcf0d20fda4ea26e391b28752bf98fe8cc8a..cffd137ac8152bcdad774d7135a2cdb23f22ddc0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hashmap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hashmap.md @@ -195,7 +195,7 @@ let result = hashMap.set("Ahfbrgrbgnutfodgorrogorgrogofdfdf", 123); remove(key: K): V -删除指定key所对应元素。。 +删除指定key所对应元素。 **参数:** @@ -333,8 +333,8 @@ forEach(callbackfn: (value?: V, key?: K, map?: HashMap) => void, thisArg?: callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | V | 是 | 当前遍历到的元素键值对的值。 | -| key | K | 是 | 当前遍历到的元素键值对的键。 | +| value | V | 否 | 当前遍历到的元素键值对的值。 | +| key | K | 否 | 当前遍历到的元素键值对的键。 | | map | HashMap | 否 | 当前调用forEach方法的实例对象。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-hashset.md b/zh-cn/application-dev/reference/apis/js-apis-hashset.md index 685929bfc3552b08ab982bd1c120c215f52b6f2b..d8c3bfca464ec2ec59a349adf9492840bc139684 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-hashset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-hashset.md @@ -198,7 +198,7 @@ forEach(callbackfn: (value?: T, key?: T, set?: HashSet<T>) => void, thisAr callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | T | 是 | 当前遍历到的元素键值对的值。 | +| value | T | 否 | 当前遍历到的元素键值对的值。 | | key | T | 否 | 当前遍历到的元素键值对的值(和value相同)。 | | set | HashSet<T> | 否 | 当前调用forEach方法的实例对象。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md index b9f1f17231c91aa76c470076941053c1a2e99bd9..6de7c7f1fb9e18894843e4335e8caad80adffa66 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md @@ -524,8 +524,8 @@ forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap) => void, th callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | V | 是 | 当前遍历到的元素键值对的值。 | -| key | K | 是 | 当前遍历到的元素键值对的键。 | +| value | V | 否 | 当前遍历到的元素键值对的值。 | +| key | K | 否 | 当前遍历到的元素键值对的键。 | | map | LightWeightMap | 否 | 当前调用forEach方法的实例对象。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md b/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md index 46ffa91b13843ea03526686031cc4b73786f8d84..4d2e486b81d24584af9fdb00b4a78feb3f6a4948 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-lightweightset.md @@ -428,7 +428,7 @@ forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet<T>) => void, callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | T | 是 | 当前遍历到的元素。 | +| value | T | 否 | 当前遍历到的元素。 | | key | T | 否 | 当前遍历到的元素(和value相同)。 | | set | LightWeightSet<T> | 否 | 当前调用forEach方法的实例对象。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md index a2b99e3f368bbee9dfc6961705e9aedade6ef3f3..768853d1914f671e0915749f1a9e1472186bd6c1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md +++ b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md @@ -176,7 +176,7 @@ let result = linkedList.get(2); ### getLastIndexOf -getLastIndexOf(element: T): number; +getLastIndexOf(element: T): number 返回指定元素最后一次出现时的下标值,查找失败返回-1。 @@ -507,6 +507,7 @@ let result = linkedList.set(2, "b"); ``` ### convertToArray + convertToArray(): Array<T> 把当前LinkedList实例转换成数组,并返回转换后的数组。 @@ -575,7 +576,7 @@ linkedList.getLast(); ### [Symbol.iterator] -[Symbol.iterator]\(): IterableIterator<T>; +[Symbol.iterator]\(): IterableIterator<T> 返回一个迭代器,迭代器的每一项都是一个 JavaScript 对象,并返回该对象。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-list.md b/zh-cn/application-dev/reference/apis/js-apis-list.md index 31fdd3e13d0dfa95e7cae70b9db8e64b91826728..4caf882c015ee5feb18226bdc5ed4a552a693526 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-list.md +++ b/zh-cn/application-dev/reference/apis/js-apis-list.md @@ -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 对List中的元素进行一个排序操作。 @@ -412,6 +415,7 @@ list.sort(a, (b => b - a)); ``` ### getSubList + getSubList(fromIndex: number, toIndex: number): List<T> 根据下标截取List中的一段元素,并返回这一段List实例,包括起始值但不包括终止值。 @@ -443,6 +447,7 @@ let result2 = list.subList(2, 6); ``` ### clear + clear(): void 清除List中的所有元素,并把length置为0。 @@ -459,6 +464,7 @@ list.clear(); ``` ### set + set(index: number, element: T): T 将此 List 中指定位置的元素替换为指定元素。 @@ -489,6 +495,7 @@ list.set(2, "b"); ``` ### convertToArray + convertToArray(): Array<T> 把当前List实例转换成数组,并返回转换后的数组。 @@ -511,6 +518,7 @@ let result = list.convertToArray(); ``` ### isEmpty + isEmpty(): boolean 判断该List是否为空。 @@ -547,7 +555,7 @@ getFirst(): T **示例:** ``` -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> 返回一个迭代器,迭代器的每一项都是一个 JavaScript 对象,并返回该对象。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-plainarray.md b/zh-cn/application-dev/reference/apis/js-apis-plainarray.md index 8b706d69a8d9cfac50036e6bc71fc6a0951c2e04..be8fbccd2715f4acdd8d7febbd4f1479f95dbe48 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-plainarray.md +++ b/zh-cn/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 查找指定key第一次出现的下标值,如果没有找到该key返回-1。 @@ -143,7 +143,7 @@ let result = plainArray.getIndexOfKey("sdfs"); ### getIndexOfValue -getIndexOfValue(value: T): number; +getIndexOfValue(value: T): number 查找指定value元素第一次出现的下标值,如果没有找到该value元素返回-1。 @@ -171,7 +171,7 @@ let result = plainArray.getIndexOfValue("sddfhf"); ### getKeyAt -getKeyAt(index: number): number; +getKeyAt(index: number): number 查找指定下标的元素键值对中key值。 @@ -238,7 +238,7 @@ clone(): PlainArray<T> **示例:** ``` -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) => void, thisArg?: Object): void 通过回调函数来遍历实例对象上的元素以及元素对应的下标。 @@ -431,7 +431,7 @@ callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | value | T | 是 | 当前遍历到的元素键值对的值。 | -| index | number | 是 | 当前遍历到的元素键值对的键。 | +| index | number | 否 | 当前遍历到的元素键值对的键。 | | plainArray | PlainArray | 否 | 当前调用forEach方法的实例对象。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-queue.md b/zh-cn/application-dev/reference/apis/js-apis-queue.md index bfabc48531a3d8e81e1f1cf22eef4715150bd25d..79dbbb889a13d2a6c92778d9855acc26d53bf58c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-queue.md +++ b/zh-cn/application-dev/reference/apis/js-apis-queue.md @@ -117,6 +117,7 @@ let result = queue.getFirst(); ``` ### forEach + forEach(callbackfn: (value: T, index?: number, Queue?: Queue<T>) => void, thisArg?: Object): void diff --git a/zh-cn/application-dev/reference/apis/js-apis-stack.md b/zh-cn/application-dev/reference/apis/js-apis-stack.md index 0341c7ca8367410a6d451c128b8d4b0f730ced63..88f73c51614991f79c031f88534f0bf122fd7813 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-stack.md +++ b/zh-cn/application-dev/reference/apis/js-apis-stack.md @@ -145,6 +145,7 @@ let result = stack.locate(2); ``` ### forEach + forEach(callbackfn: (value: T, index?: number, stack?: Stack<T>) => void, thisArg?: Object): void @@ -179,6 +180,7 @@ stack.forEach((value, index) => { ``` ### isEmpty + isEmpty(): boolean 判断该栈是否为空。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-treemap.md b/zh-cn/application-dev/reference/apis/js-apis-treemap.md index 796112066e342dd7fe36577480a0481f3962d2b1..d49b3e210e250dac04158bf37f36622d79885db5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-treemap.md +++ b/zh-cn/application-dev/reference/apis/js-apis-treemap.md @@ -45,7 +45,7 @@ let treeMap = new TreeMap(); ### isEmpty -isEmpty(): boolean; +isEmpty(): boolean 判断该容器是否为空。 @@ -65,7 +65,7 @@ let result = treeMap.isEmpty(); ### hasKey -hasKey(key: K): boolean; +hasKey(key: K): boolean 判断此容器中是否含有该指定key。 @@ -149,7 +149,7 @@ let result = treeMap.get("sdfs"); ### getFirstKey -getFirstKey(): K; +getFirstKey(): K 获取容器中排序第一的key。 @@ -171,7 +171,7 @@ let result = treeMap.getFirstKey(); ### getLastKey -getLastKey(): K; +getLastKey(): K 获取容器中排序最后的key。 @@ -215,6 +215,7 @@ treeMap.setAll(map); ### set + set(key: K, value: V): Object 向treemap中添加一组数据。 @@ -242,7 +243,7 @@ treeMap.set("Ahfbrgrbgnutfodgorrogorgrogofdfdf", 123); ### remove -remove(key: K): V; +remove(key: K): V 删除指定key对应的元素。 @@ -326,6 +327,7 @@ let result = treeMap.getHigherKey("sdfs"); ``` ### replace + replace(key: K, newValue: V): boolean 对TreeMap中一组数据进行更新(替换)。 @@ -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 通过回调函数来遍历实例对象上的元素以及元素对应的下标。 @@ -438,8 +440,8 @@ forEach(callbackfn: (value: V, key?: K, map?: TreeMap) => void, thisArg?: callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | V | 是 | 当前遍历到的元素键值对的值。 | -| key | K | 是 | 当前遍历到的元素键值对的键。 | +| value | V | 否 | 当前遍历到的元素键值对的值。 | +| key | K | 否 | 当前遍历到的元素键值对的键。 | | map | TreeMap | 否 | 当前调用forEach方法的实例对象。 | **示例:** @@ -484,7 +486,7 @@ while(temp != undefined) { ### [Symbol.iterator] -[Symbol.iterator]\(): IterableIterator<[K, V]>; +[Symbol.iterator]\(): IterableIterator<[K, V]> 返回一个迭代器,迭代器的每一项都是一个 JavaScript 对象,并返回该对象。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-treeset.md b/zh-cn/application-dev/reference/apis/js-apis-treeset.md index 48c65fea23227ff1113273dc6aff3f772ab2ab99..473db461ba74cc8b961402595ee66d9abea2c3d7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-treeset.md +++ b/zh-cn/application-dev/reference/apis/js-apis-treeset.md @@ -136,6 +136,7 @@ let result = treeSet.getLastValue(); ### add + add(value: T): boolean 向TreeSet中添加一组数据。 @@ -162,7 +163,7 @@ let result = treeSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf"); ### remove -remove(value: T): boolean; +remove(value: T): boolean 删除指定的元素。 @@ -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 通过回调函数来遍历实例对象上的元素以及元素对应的下标。 @@ -349,7 +350,7 @@ forEach(callbackfn: (value: T, key?: T, set?: TreeSet<T>) => void, thisArg callbackfn的参数说明: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| value | T | 是 | 当前遍历到的元素。 | +| value | T | 否 | 当前遍历到的元素。 | | key | T | 否 | 当前遍历到的元素(和value相同)。 | | set | TreeSet<T> | 否 | 当前调用forEach方法的实例对象。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-vector.md b/zh-cn/application-dev/reference/apis/js-apis-vector.md index 23351ac3b6c21bd45cb5b5b90acc826791ae9635..e6ddff2aec31f60981b997b5ac4633376b169c8a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-vector.md +++ b/zh-cn/application-dev/reference/apis/js-apis-vector.md @@ -241,7 +241,8 @@ let result = vector.remove(2); ``` ### removeByRange -removeByRange(fromIndex: number, toIndex: number): void; + +removeByRange(fromIndex: number, toIndex: number): void 从一段范围内删除元素,包括起始值但不包括终止值。 @@ -266,6 +267,7 @@ vector.removeByRange(2,6); ``` ### replaceAllElements + replaceAllElements(callbackfn: (value: T, index?: number, vector?: Vector<T>) => T, thisArg?: Object): void @@ -303,8 +305,9 @@ vector.replaceAllElements((value, index) => { ``` ### forEach + forEach(callbackfn: (value: T, index?: number, vector?: Vector<T>) => void, -thisArg?: Object): void; +thisArg?: Object): void 通过回调函数来遍历Vector实例对象上的元素以及元素对应的下标。 @@ -338,6 +341,7 @@ vector.forEach((value, index) => { ``` ### sort + sort(comparator?: (firstValue: T, secondValue: T) => number): void 对Vector中的元素进行一个排序操作。 @@ -369,6 +373,7 @@ vector.sort(); ``` ### subVector + subVector(fromIndex: number, toIndex: number): Vector<T> 根据下标截取Vector中的一段元素,并返回这一段vector实例,包括起始值但不包括终止值。 @@ -401,6 +406,7 @@ let result2 = vector.subVector(2,6); ``` ### clear + clear(): void 清除Vector中的所有元素,并把length置为0。 @@ -417,6 +423,7 @@ vector.clear(); ``` ### clone + clone(): Vector<T> 克隆一个与Vector相同的实例,并返回克隆后的实例。修改克隆后的实例并不会影响原实例。 @@ -439,6 +446,7 @@ let result = vector.clone(); ``` ### getCapacity + getCapacity(): number 获取当前实例的容量大小。 @@ -461,6 +469,7 @@ let result = vector.getCapacity(); ``` ### convertToArray + convertToArray(): Array<T> 把当前Vector实例转换成数组,并返回转换后的数组。 @@ -483,6 +492,7 @@ let result = vector.convertToArray(); ``` ### isEmpty + isEmpty(): boolean 判断该Vector是否为空。 @@ -505,6 +515,7 @@ let result = vector.isEmpty(); ``` ### increaseCapacityTo + increaseCapacityTo(newCapacity: number): void 如果传入的新容量大于或等于Vector中的元素个数,将容量变更为新容量。 @@ -699,6 +710,7 @@ let result = vector.getIndexFrom(4, 3); ``` ### setLength + setLength(newSize: number): void 设置Vector实例的元素个数。 @@ -722,6 +734,7 @@ vector.setLength(2); ``` ### get + get(index: number): T 根据下标值获取Vector实例中的元素。 @@ -749,6 +762,7 @@ get(index: number): T let result = vector.get(2); ``` ### set + set(index: number, element: T): T 将此Vector中指定位置的元素替换为指定元素。