提交 91711548 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 3d43f67e
...@@ -154,7 +154,6 @@ deque.insertEnd(4); ...@@ -154,7 +154,6 @@ deque.insertEnd(4);
deque.insertFront(5); deque.insertFront(5);
deque.insertFront(2); deque.insertFront(2);
deque.insertFront(4); deque.insertFront(4);
deque.popLast();
let result = deque.popLast(); let result = deque.popLast();
``` ```
......
...@@ -319,7 +319,7 @@ let result = hashMap.replace("sdfs", 357); ...@@ -319,7 +319,7 @@ let result = hashMap.replace("sdfs", 357);
### forEach ### forEach
forEach(callbackfn: (value: V, key?: K, map?: HashMap<K, V>) => void, thisArg?: Object): void forEach(callbackfn: (value?: V, key?: K, map?: HashMap<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.
......
...@@ -184,7 +184,7 @@ while(temp != undefined) { ...@@ -184,7 +184,7 @@ while(temp != undefined) {
### forEach ### forEach
forEach(callbackfn: (value: T, key?: T, set?: HashSet&lt;T&gt;) => void, thisArg?: Object): void forEach(callbackfn: (value?: T, key?: T, set?: HashSet&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.
......
...@@ -510,7 +510,7 @@ while(temp != undefined) { ...@@ -510,7 +510,7 @@ while(temp != undefined) {
### forEach ### forEach
forEach(callbackfn: (value: V, key?: K, map?: LightWeightMap<K, V>) => void, thisArg?: Object): void forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap<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.
...@@ -569,7 +569,7 @@ while(temp != undefined) { ...@@ -569,7 +569,7 @@ while(temp != undefined) {
### toString ### toString
toString(): string toString(): String
Concatenates the entries in this container into a string and returns the string. Concatenates the entries in this container into a string and returns the string.
...@@ -577,7 +577,7 @@ Concatenates the entries in this container into a string and returns the string. ...@@ -577,7 +577,7 @@ Concatenates the entries in this container into a string and returns the string.
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| string | Returns a string.| | String | Returns a string.|
**Example** **Example**
......
...@@ -160,7 +160,7 @@ Checks whether this container has the specified key. ...@@ -160,7 +160,7 @@ Checks whether this container has the specified key.
let lightWeightSet = new LightWeightSet(); let lightWeightSet = new LightWeightSet();
let result = lightWeightSet.has(123); let result = lightWeightSet.has(123);
lightWeightSet.add(123); lightWeightSet.add(123);
let result = lightWeightSet.has(123); result = lightWeightSet.has(123);
``` ```
...@@ -188,7 +188,7 @@ Checks whether this container contains objects of the same type as the specified ...@@ -188,7 +188,7 @@ Checks whether this container contains objects of the same type as the specified
let lightWeightSet = new LightWeightSet(); let lightWeightSet = new LightWeightSet();
lightWeightSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf"); lightWeightSet.add("Ahfbrgrbgnutfodgorrogorgrogofdfdf");
lightWeightSet.add("sdfs"); lightWeightSet.add("sdfs");
let obj = {"Ahfbrgrbgnutfodgorrogorgrogofdfdf", "sdfs"}; let obj = ["Ahfbrgrbgnutfodgorrogorgrogofdfdf", "sdfs"];
let result = lightWeightSet.equal(obj); let result = lightWeightSet.equal(obj);
``` ```
...@@ -223,7 +223,7 @@ Obtains the position index of the entry with the specified key in this container ...@@ -223,7 +223,7 @@ Obtains the position index of the entry with the specified key in this container
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| key | T | Yes| Key of the entry to query.| | key| T | Yes| Key of the entry to query.|
**Return value** **Return value**
...@@ -251,7 +251,7 @@ Removes an entry of the specified key from this container. ...@@ -251,7 +251,7 @@ Removes an entry of the specified key from this container.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| key | T | Yes| Key of the entry to remove.| | key| T | Yes| Key of the entry to remove.|
**Return value** **Return value**
...@@ -414,7 +414,7 @@ while(index < lightWeightSet.length) { ...@@ -414,7 +414,7 @@ while(index < lightWeightSet.length) {
### forEach ### forEach
forEach(callbackfn: (value: T, key?: T, set?: LightWeightSet&lt;T&gt;) => void, thisArg?: Object): void forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet&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.
...@@ -429,7 +429,7 @@ callbackfn ...@@ -429,7 +429,7 @@ 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.|
| 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 | LightWeightSet&lt;T&gt; | No| Instance that invokes the **forEach** method.| | set | LightWeightSet&lt;T&gt; | No| Instance that invokes the **forEach** method.|
**Example** **Example**
......
...@@ -27,16 +27,10 @@ SystemCapability.Utils.Lang ...@@ -27,16 +27,10 @@ SystemCapability.Utils.Lang
### constructor ### constructor
constructor(head?: NodeObj&lt;T&gt;, tail?: NodeObj&lt;T&gt;) constructor()
A constructor used to create a **LinkedList** instance. A constructor used to create a **LinkedList** instance.
**Parameters**
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| head | NodeObj&lt;T&gt; | Yes| No| Node object, including **element**, **next**, and **prev**.|
| tail | NodeObj&lt;T&gt; | Yes| No| Node object, including **element**, **next**, and **prev**.|
**Example** **Example**
...@@ -300,7 +294,7 @@ let result = linkedList.removeFirst(); ...@@ -300,7 +294,7 @@ let result = linkedList.removeFirst();
### removeLast ### removeLast
removeLst(): T removeLast(): T
Removes the last entry from this container. Removes the last entry from this container.
......
...@@ -27,15 +27,10 @@ SystemCapability.Utils.Lang ...@@ -27,15 +27,10 @@ SystemCapability.Utils.Lang
### constructor ### constructor
constructor(head?: NodeObj&lt;T&gt;) constructor()
A constructor used to create a **List** instance. A constructor used to create a **List** instance.
**Parameters**
| Name| Value Type | Readable| Description|
| -------- | -------- | -------- | -------- |
| head | NodeObj&lt;T&gt; | Yes| Node object, including **element** and **next**.|
**Example** **Example**
...@@ -106,7 +101,7 @@ Checks whether this container has the specified entry. ...@@ -106,7 +101,7 @@ Checks whether this container has the specified entry.
| Name| Value Type | Mandatory| Description| | Name| Value Type | Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| element | T | Yes| Entry to query.| | element | T | Yes| Entry to check.|
**Return value** **Return value**
...@@ -465,6 +460,7 @@ list.clear(); ...@@ -465,6 +460,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.
**Parameters** **Parameters**
......
...@@ -416,7 +416,7 @@ plainArray.clear(); ...@@ -416,7 +416,7 @@ plainArray.clear();
### forEach ### forEach
forEach(callbackfn: (value: T, key?: number, PlainArray?: PlainArray<number, T>) => 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. 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.|
| key | number | Yes| Key of the entry that is currently traversed.| | index | number | Yes| Key of the entry that is currently traversed.|
| plainArray | PlainArray<number, T> | No| Instance that invokes the **forEach** API.| | plainArray | PlainArray<T> | No| Instance that invokes the **forEach** API.|
**Example** **Example**
......
...@@ -569,6 +569,7 @@ let result = vector.toSting(); ...@@ -569,6 +569,7 @@ let result = vector.toSting();
### copyToArray ### copyToArray
copyToArray(array: Array&lt;T&gt;): void copyToArray(array: Array&lt;T&gt;): void
Copies entries in this container into an array to overwrite elements of the same position indexes. Copies entries in this container into an array to overwrite elements of the same position indexes.
**Parameters** **Parameters**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册