提交 5cba2991 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 ee0ce630
......@@ -264,6 +264,7 @@ arrayList.removeByRange(2, 6);
```
### replaceAllElements
replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList&lt;T&gt;) => T,
thisArg?: Object): void
......@@ -301,6 +302,7 @@ arrayList.replaceAllElements((value, index) => {
```
### forEach
forEach(callbackfn: (value: T, index?: number, arrlist?: ArrayList&lt;T&gt;) => void,
thisArg?: Object): void
......@@ -335,6 +337,7 @@ arrayList.forEach((value, index) => {
```
### sort
sort(comparator?: (firstValue: T, secondValue: T) => number): void
Sorts entries in this container.
......@@ -366,6 +369,7 @@ arrayList.sort();
```
### subArrayList
subArrayList(fromIndex: number, toIndex: number): ArrayList&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 **ArrayList** instance.
......@@ -397,6 +401,7 @@ let result3 = arrayList.subArrayList(2, 6);
```
### clear
clear(): void
Clears this container and sets its length to **0**.
......@@ -413,6 +418,7 @@ arrayList.clear();
```
### clone
clone(): ArrayList&lt;T&gt;
Clones this container and returns a copy. The modification to the copy does not affect the original instance.
......@@ -436,6 +442,7 @@ let result = arrayList.clone();
```
### getCapacity
getCapacity(): number
Obtains the capacity of this container.
......@@ -458,6 +465,7 @@ let result = arrayList.getCapacity();
```
### convertToArray
convertToArray(): Array&lt;T&gt;
Converts this container into an array.
......@@ -480,6 +488,7 @@ let result = arrayList.convertToArray();
```
### isEmpty
isEmpty(): boolean
Checks whether this container is empty (contains no entry).
......@@ -502,6 +511,7 @@ let result = arrayList.isEmpty();
```
### increaseCapacityTo
increaseCapacityTo(newCapacity: number): void
Increases the capacity of this container.
......@@ -525,6 +535,7 @@ arrayList.increaseCapacityTo(8);
```
### trimToCurrentLength
trimToCurrentLength(): void
Trims the capacity of this container to its current length.
......
......@@ -158,6 +158,7 @@ let result = deque.popLast();
```
### forEach
forEach(callbackfn: (value: T, index?: number, deque?: Deque&lt;T&gt;) => void,
thisArg?: Object): void
......@@ -193,7 +194,7 @@ deque.forEach((value, index) => {
### getFirst
getFirst(): T;
getFirst(): T
Obtains the first entry of this container.
......
......@@ -198,7 +198,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 | HashSet&lt;T&gt; | No| Instance that invokes the **forEach** method.|
......
......@@ -524,8 +524,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 | LightWeightMap<K, V> | No| Instance that invokes the **forEach** method.|
**Example**
......
......@@ -279,7 +279,7 @@ Removes the entry at the specified position from this container.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| index | number | Yes| Position index of the entry to remove.|
| index | number | Yes| Position index of the entry.|
**Return value**
......
......@@ -117,6 +117,7 @@ let result = queue.getFirst();
```
### forEach
forEach(callbackfn: (value: T, index?: number, Queue?: Queue&lt;T&gt;) => void,
thisArg?: Object): void
......
......@@ -145,6 +145,7 @@ let result = stack.locate(2);
```
### forEach
forEach(callbackfn: (value: T, index?: number, stack?: Stack&lt;T&gt;) => void,
thisArg?: Object): void
......@@ -179,6 +180,7 @@ stack.forEach((value, index) => {
```
### isEmpty
isEmpty(): boolean
Checks whether this container is empty (contains no entries).
......
......@@ -241,7 +241,8 @@ let result = vector.remove(2);
```
### removeByRange
removeByRange(fromIndex: number, toIndex: number): void;
removeByRange(fromIndex: number, toIndex: number): void
Removes from this container all of the entries within a range, including the entry at the start position but not that at the end position.
......@@ -266,6 +267,7 @@ vector.removeByRange(2,6);
```
### replaceAllElements
replaceAllElements(callbackfn: (value: T, index?: number, vector?: Vector&lt;T&gt;) => T,
thisArg?: Object): void
......@@ -303,8 +305,9 @@ vector.replaceAllElements((value, index) => {
```
### forEach
forEach(callbackfn: (value: T, index?: number, vector?: Vector&lt;T&gt;) => void,
thisArg?: Object): void;
thisArg?: Object): void
Uses a callback to traverse the entries in this container and obtain their position indexes.
......@@ -338,6 +341,7 @@ vector.forEach((value, index) => {
```
### sort
sort(comparator?: (firstValue: T, secondValue: T) => number): void
Sorts entries in this container.
......@@ -369,6 +373,7 @@ vector.sort();
```
### subVector
subVector(fromIndex: number, toIndex: number): Vector&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 **Vector** instance.
......@@ -401,6 +406,7 @@ let result2 = vector.subVector(2,6);
```
### clear
clear(): void
Clears all entries in this container and sets its length to **0**.
......@@ -417,6 +423,7 @@ vector.clear();
```
### clone
clone(): Vector&lt;T&gt;
Clones this container and returns a copy. The modification to the copy does not affect the original instance.
......@@ -439,6 +446,7 @@ let result = vector.clone();
```
### getCapacity
getCapacity(): number
Obtains the capacity of this container.
......@@ -461,6 +469,7 @@ let result = vector.getCapacity();
```
### convertToArray
convertToArray(): Array&lt;T&gt;
Converts this container into an array.
......@@ -483,6 +492,7 @@ let result = vector.convertToArray();
```
### isEmpty
isEmpty(): boolean
Checks whether this container is empty (contains no entries).
......@@ -505,6 +515,7 @@ let result = vector.isEmpty();
```
### increaseCapacityTo
increaseCapacityTo(newCapacity: number): void
Increases the capacity of this container.
......@@ -700,6 +711,7 @@ let result = vector.getIndexFrom(4, 3);
```
### setLength
setLength(newSize: number): void
Sets a new length for this container.
......@@ -723,6 +735,7 @@ vector.setLength(2);
```
### get
get(index: number): T
Obtains an entry at the specified position in this container.
......@@ -750,6 +763,7 @@ Obtains an entry at the specified position in this container.
let result = vector.get(2);
```
### set
set(index: number, element: T): T
Replaces an entry at the specified position in this container with a given entry.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册