@@ -67,6 +80,14 @@ Adds an element at the end of this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
...
...
@@ -76,7 +97,13 @@ Adds an element at the end of this container.
letb=[1,2,3];
letresult2=arrayList.add(b);
letc={name:"Dylon",age:"13"};
letresult3=arrayList.add(false);
letresult3=arrayList.add(c);
letresult4=arrayList.add(false);
try{
arrayList.add.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -94,6 +121,15 @@ Inserts an element at the specified position in this container.
| element | T | Yes| Target element.|
| index | number | Yes| Index of the position where the element is to be inserted.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The insert method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -101,6 +137,21 @@ let arrayList = new ArrayList();
arrayList.insert("A",0);
arrayList.insert(0,1);
arrayList.insert(true,2);
try{
arrayList.insert.bind({},1,2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -123,6 +174,14 @@ Checks whether this container has the specified element.
| -------- | -------- |
| boolean | Returns **true** if the specified element is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -130,6 +189,11 @@ let arrayList = new ArrayList();
letresult=arrayList.has("squirrel");
arrayList.add("squirrel");
letresult1=arrayList.has("squirrel");
try{
arrayList.has.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -152,6 +216,14 @@ Obtains the index of the first occurrence of the specified element in this conta
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** if the specified element is not found.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -164,6 +236,11 @@ arrayList.add(1);
arrayList.add(2);
arrayList.add(4);
letresult=arrayList.getIndexOf(2);
try{
arrayList.getIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -186,6 +263,14 @@ Obtains the index of the last occurrence of the specified element in this contai
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** if the specified element is not found.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLastIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -198,6 +283,11 @@ arrayList.add(1);
arrayList.add(2);
arrayList.add(4);
letresult=arrayList.getLastIndexOf(2);
try{
arrayList.getLastIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -220,6 +310,15 @@ Removes an element with the specified position from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeByIndex method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -230,6 +329,21 @@ arrayList.add(5);
arrayList.add(2);
arrayList.add(4);
letresult=arrayList.removeByIndex(2);
try{
arrayList.removeByIndex.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -252,6 +366,14 @@ Removes the first occurrence of the specified element from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -261,6 +383,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
letresult=arrayList.remove(2);
try{
arrayList.remove.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -278,6 +405,15 @@ Removes from this container all of the elements within a range, including the el
| fromIndex | number | Yes| Index of the start position.|
| toIndex | number | Yes| Index of the end position.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeByRange method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -287,8 +423,16 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.removeByRange(2,4);
arrayList.removeByRange(4,3);
arrayList.removeByRange(2,6);
try{
arrayList.removeByRange.bind({},2,4)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The sort method cannot be bound. |
**Example**
```ts
...
...
@@ -400,6 +582,11 @@ arrayList.add(4);
arrayList.sort((a:number,b:number)=>a-b);
arrayList.sort((a:number,b:number)=>b-a);
arrayList.sort();
try{
arrayList.sort.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -423,6 +610,15 @@ Obtains elements within a range in this container, including the element at the
| -------- | -------- |
| ArrayList<T> | New **ArrayList** instance obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The subArrayList method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -434,6 +630,16 @@ arrayList.add(4);
letresult1=arrayList.subArrayList(2,4);
letresult2=arrayList.subArrayList(4,3);
letresult3=arrayList.subArrayList(2,6);
try{
arrayList.subArrayList.bind({},2,4)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -453,6 +667,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.clear();
try{
arrayList.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -470,6 +689,14 @@ Clones this container and returns a copy. The modification to the copy does not
| -------- | -------- |
| ArrayList<T> | New **ArrayList** instance obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clone method cannot be bound. |
**Example**
```ts
...
...
@@ -479,6 +706,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
letresult=arrayList.clone();
try{
arrayList.clone.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -495,6 +727,14 @@ Obtains the capacity of this container.
| -------- | -------- |
| number | Capacity obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getCapacity method cannot be bound. |
**Example**
```ts
...
...
@@ -504,6 +744,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
letresult=arrayList.getCapacity();
try{
arrayList.getCapacity.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -520,6 +765,14 @@ Converts this container into an array.
| -------- | -------- |
| Array<T> | Array obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The convertToArray method cannot be bound. |
**Example**
```ts
...
...
@@ -529,6 +782,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
letresult=arrayList.convertToArray();
try{
arrayList.convertToArray.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -545,6 +803,14 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
...
...
@@ -554,6 +820,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
letresult=arrayList.isEmpty();
try{
arrayList.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -570,6 +841,14 @@ Increases the capacity of this container.
| -------- | -------- | -------- | -------- |
| newCapacity | number | Yes| New capacity.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The increaseCapacityTo method cannot be bound. |
**Example**
```ts
...
...
@@ -580,6 +859,11 @@ arrayList.add(5);
arrayList.add(4);
arrayList.increaseCapacityTo(2);
arrayList.increaseCapacityTo(8);
try{
arrayList.increaseCapacityTo.bind({},5)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The trimToCurrentLength method cannot be bound. |
**Example**
```ts
...
...
@@ -599,6 +891,11 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.trimToCurrentLength();
try{
arrayList.trimToCurrentLength.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -615,6 +912,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -636,4 +941,9 @@ while(temp != undefined) {
console.log(`value:${temp}`);
temp=iter.next().value;
}
try{
arrayList[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -59,6 +72,14 @@ Inserts an element at the front of this container.
| -------- | -------- | -------- | -------- |
| element | T | Yes| Target element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The insertFront method cannot be bound. |
**Example**
```ts
...
...
@@ -68,7 +89,13 @@ deque.insertFront(1);
letb=[1,2,3];
deque.insertFront(b);
letc={name:"Dylon",age:"13"};
deque.insertFront(c);
deque.insertFront(false);
try{
deque.insertFront.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -85,6 +112,14 @@ Inserts an element at the end of this container.
| -------- | -------- | -------- | -------- |
| element | T | Yes| Target element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The insertEnd method cannot be bound. |
**Example**
```ts
...
...
@@ -94,7 +129,13 @@ deque.insertEnd(1);
letb=[1,2,3];
deque.insertEnd(b);
letc={name:"Dylon",age:"13"};
deque.insertEnd(c);
deque.insertEnd(false);
try{
deque.insertEnd.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -117,6 +158,14 @@ Checks whether this container has the specified element.
| -------- | -------- |
| boolean | Returns **true** if the specified element is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -124,6 +173,11 @@ let deque = new Deque();
letresult=deque.has("squirrel");
deque.insertFront("squirrel");
letresult1=deque.has("squirrel");
try{
deque.has.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -140,6 +194,14 @@ Removes the first element of this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The popFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -150,6 +212,11 @@ deque.insertEnd(5);
deque.insertFront(2);
deque.insertFront(4);
letresult=deque.popFirst();
try{
deque.popFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -166,6 +233,14 @@ Removes the last element of this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The popLast method cannot be bound. |
**Example**
```ts
...
...
@@ -176,6 +251,11 @@ deque.insertFront(5);
deque.insertFront(2);
deque.insertFront(4);
letresult=deque.popLast();
try{
deque.popLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -229,6 +324,14 @@ Obtains the first element of this container.
| -------- | -------- |
| T | Element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -238,6 +341,11 @@ deque.insertEnd(4);
deque.insertFront(5);
deque.insertFront(4);
letresult=deque.getFirst();
try{
deque.getFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -254,6 +362,14 @@ Obtains the last element of this container.
| -------- | -------- |
| T | Element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLast method cannot be bound. |
**Example**
```ts
...
...
@@ -263,6 +379,11 @@ deque.insertFront(4);
deque.insertFront(5);
deque.insertFront(4);
letresult=deque.getLast();
try{
deque.getLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -279,6 +400,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
letdeque=newDeque();
...
...
@@ -299,4 +428,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
deque[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -62,11 +75,24 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
consthashMap=newHashMap();
letresult=hashMap.isEmpty();
try{
hashMap.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -90,6 +116,14 @@ Checks whether this container contains the specified key.
| -------- | -------- |
| boolean | Returns **true** if the specified key is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The hasKey method cannot be bound. |
**Example**
```ts
...
...
@@ -97,6 +131,11 @@ let hashMap = new HashMap();
letresult=hashMap.hasKey("squirrel");
hashMap.set("squirrel",123);
letresult1=hashMap.hasKey("squirrel");
try{
hashMap.hasKey.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -120,6 +159,14 @@ Checks whether this container contains the specified value.
| -------- | -------- |
| boolean | Returns **true** if the specified value is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The hasValue method cannot be bound. |
**Example**
```ts
...
...
@@ -127,6 +174,11 @@ let hashMap = new HashMap();
letresult=hashMap.hasValue(123);
hashMap.set("squirrel",123);
letresult1=hashMap.hasValue(123);
try{
hashMap.hasValue.bind({},123)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -150,6 +202,14 @@ Obtains the value of the specified key in this container.
| -------- | -------- |
| V | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The get method cannot be bound. |
**Example**
```ts
...
...
@@ -157,6 +217,11 @@ let hashMap = new HashMap();
hashMap.set("squirrel",123);
hashMap.set("sparrow",356);
letresult=hashMap.get("sparrow");
try{
hashMap.get.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
hashMap.setAll.bind({},newHashMap)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -206,11 +284,24 @@ Adds an element to this container.
| -------- | -------- |
| Object | Container that contains the new element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The set method cannot be bound. |
**Example**
```ts
lethashMap=newHashMap();
letresult=hashMap.set("squirrel",123);
try{
hashMap.set.bind({},"squirrel",123)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -234,6 +325,14 @@ Removes an element with the specified key from this container.
| -------- | -------- |
| V | Value of the element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -241,6 +340,11 @@ let hashMap = new HashMap();
hashMap.set("squirrel",123);
hashMap.set("sparrow",356);
letresult=hashMap.remove("sparrow");
try{
hashMap.remove.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -259,6 +371,11 @@ let hashMap = new HashMap();
hashMap.set("squirrel",123);
hashMap.set("sparrow",356);
hashMap.clear();
try{
hashMap.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -276,6 +393,14 @@ Obtains an iterator that contains all the elements in this container.
| -------- | -------- |
| IterableIterator<K> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The keys method cannot be bound. |
**Example**
```ts
...
...
@@ -288,6 +413,11 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
hashMap.keys.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -305,6 +435,14 @@ Obtains an iterator that contains all the values in this container.
| -------- | -------- |
| IterableIterator<V> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The values method cannot be bound. |
**Example**
```ts
...
...
@@ -317,6 +455,11 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
hashMap.values.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -341,12 +484,25 @@ Replaces an element in this container.
| -------- | -------- |
| boolean | Returns **true** if the element is replaced successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The replace method cannot be bound. |
**Example**
```ts
lethashMap=newHashMap();
hashMap.set("sparrow",123);
letresult=hashMap.replace("sparrow",357);
try{
hashMap.replace.bind({},"sparrow",357)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The entries method cannot be bound. |
**Example**
```ts
...
...
@@ -411,6 +590,11 @@ while(temp != undefined) {
console.log("value:"+temp[1]);
temp=iter.next().value;
}
try{
hashMap.entries.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
lethashMap=newHashMap();
...
...
@@ -448,4 +640,9 @@ while(temp != undefined) {
console.log("value:"+temp[1]);
temp=iter.next().value;
}
try{
hashMap[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -70,11 +83,24 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
consthashSet=newHashSet();
letresult=hashSet.isEmpty();
try{
hashSet.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -98,6 +124,14 @@ Checks whether this container contains the specified element.
| -------- | -------- |
| boolean | Returns **true** if the specified element is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -105,6 +139,11 @@ let hashSet = new HashSet();
letresult=hashSet.has("squirrel");
hashSet.add("squirrel");
letresult1=hashSet.has("squirrel");
try{
hashSet.has.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -128,11 +167,24 @@ Adds an element to this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
lethashSet=newHashSet();
letresult=hashSet.add("squirrel");
try{
hashSet.add.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -156,6 +208,14 @@ Removes an element from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -163,6 +223,11 @@ let hashSet = new HashSet();
hashSet.add("squirrel");
hashSet.add("sparrow");
letresult=hashSet.remove("sparrow");
try{
hashSet.remove.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -181,6 +254,11 @@ let hashSet = new HashSet();
hashSet.add("squirrel");
hashSet.add("sparrow");
hashSet.clear();
try{
hashSet.remove.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -198,6 +276,14 @@ Obtains an iterator that contains all the values in this container.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The values method cannot be bound. |
**Example**
```ts
...
...
@@ -209,7 +295,12 @@ let temp = iter.next().value;
while(temp!=undefined){
console.log("value:"+temp);
temp=iter.next().value;
}
}
try{
hashSet.values.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -260,6 +366,14 @@ Obtains an iterator that contains all the elements in this container.
| -------- | -------- |
| IterableIterator<[T,T]> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The entries method cannot be bound. |
**Example**
```ts
...
...
@@ -273,6 +387,11 @@ while(temp != undefined) {
console.log("value:"+temp[1]);
temp=iter.next().value;
}
try{
hashSet.entries.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -290,6 +409,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -309,4 +436,9 @@ while(temp != undefined) {
console.log("value: "+temp);
temp=iter.next().value;
}
try{
hashSet[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -65,11 +78,24 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
constlightWeightSet=newLightWeightSet();
letresult=lightWeightSet.isEmpty();
try{
lightWeightSet.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -92,11 +118,24 @@ Adds an element to this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
letlightWeightSet=newLightWeightSet();
letresult=lightWeightSet.add("squirrel");
try{
lightWeightSet.add.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
lightWeightSet.addAll.bind({},set)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
lightWeightSet.hasAll.bind({},set)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -178,6 +243,14 @@ Checks whether this container has the specified key.
| -------- | -------- |
| boolean | Returns **true** if the specified key is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -185,6 +258,11 @@ let lightWeightSet = new LightWeightSet();
letresult=lightWeightSet.has(123);
lightWeightSet.add(123);
result=lightWeightSet.has(123);
try{
lightWeightSet.has.bind({},123)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
lightWeightSet.equal.bind({},obj)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -233,11 +324,30 @@ Increases the capacity of this container.
| -------- | -------- | -------- | -------- |
| minimumCapacity | number | Yes| Minimum number of elements to accommodate in the container.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The increaseCapacityTo method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
letlightWeightSet=newLightWeightSet();
lightWeightSet.increaseCapacityTo(10);
try{
lightWeightSet.increaseCapacityTo.bind({},10)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -261,6 +371,14 @@ Obtains the position index of the element with the specified key in this contain
| -------- | -------- |
| number | Position index of the element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -268,6 +386,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.getIndexOf("sparrow");
try{
lightWeightSet.getIndexOf.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -291,6 +414,14 @@ Removes an element of the specified key from this container.
| -------- | -------- |
| T | Value of the element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -298,6 +429,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.remove("sparrow");
try{
lightWeightSet.remove.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -321,6 +457,14 @@ Removes the element at the specified position from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeAt method cannot be bound. |
**Example**
```ts
...
...
@@ -328,6 +472,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.removeAt(1);
try{
lightWeightSet.removeAt.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -351,6 +500,14 @@ Obtains the value of the element at the specified position in this container.
| -------- | -------- |
| T | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getValueAt method cannot be bound. |
**Parameters**
```ts
...
...
@@ -358,6 +515,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.getValueAt(1);
try{
lightWeightSet.getValueAt.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -376,6 +546,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
lightWeightSet.clear();
try{
lightWeightSet.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -393,6 +568,14 @@ Obtains a string that contains all elements in this container.
| -------- | -------- |
| String | String obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The toString method cannot be bound. |
**Example**
```ts
...
...
@@ -400,6 +583,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.toString();
try{
lightWeightSet.toString.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -417,6 +605,14 @@ Obtains an array that contains all objects in this container.
| -------- | -------- |
| Array<T> | Array obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The toArray method cannot be bound. |
**Example**
```ts
...
...
@@ -424,6 +620,11 @@ let lightWeightSet = new LightWeightSet();
lightWeightSet.add("squirrel");
lightWeightSet.add("sparrow");
letresult=lightWeightSet.toArray();
try{
lightWeightSet.toArray.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
lightWeightSet.values.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
lightWeightSet.entries.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -533,6 +775,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -552,4 +802,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
lightWeightSet[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -71,6 +84,14 @@ Adds an element at the end of this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
...
...
@@ -78,9 +99,15 @@ let linkedList = new LinkedList();
letresult=linkedList.add("a");
letresult1=linkedList.add(1);
letb=[1,2,3];
linkedList.add(b);
letresult2=linkedList.add(b);
letc={name:"Dylon",age:"13"};
letresult3=linkedList.add(false);
letresult3=linkedList.add(c);
letresult4=linkedList.add(false);
try{
linkedList.add.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -97,6 +124,14 @@ Adds an element at the top of this container.
| -------- | -------- | -------- | -------- |
| element | T | Yes| Target element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The addFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -106,7 +141,13 @@ linkedList.addFirst(1);
letb=[1,2,3];
linkedList.addFirst(b);
letc={name:"Dylon",age:"13"};
linkedList.addFirst(c);
linkedList.addFirst(false);
try{
linkedList.addFirst.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -124,6 +165,15 @@ Inserts an element at the specified position in this container.
| element | T | Yes| Target element.|
| index | number | Yes| Index of the position where the element is to be inserted.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The insert method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -131,6 +181,16 @@ let linkedList = new LinkedList();
linkedList.insert(0,"A");
linkedList.insert(1,0);
linkedList.insert(2,true);
try{
linkedList.insert.bind({},3,"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -153,6 +213,14 @@ Checks whether this container has the specified element.
| -------- | -------- |
| boolean | Returns **true** if the specified element is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -160,6 +228,11 @@ let linkedList = new LinkedList();
letresult1=linkedList.has("squirrel");
linkedList.add("squirrel");
letresult=linkedList.has("squirrel");
try{
linkedList.has.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -182,6 +255,14 @@ Obtains an element at the specified position in this container.
| -------- | -------- |
| T | Element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The get method cannot be bound. |
**Example**
```ts
...
...
@@ -194,6 +275,11 @@ linkedList.add(1);
linkedList.add(2);
linkedList.add(4);
letresult=linkedList.get(2);
try{
linkedList.get.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -216,6 +302,14 @@ Obtains the index of the last occurrence of the specified element in this contai
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLastIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -228,6 +322,11 @@ linkedList.add(1);
linkedList.add(2);
linkedList.add(4);
letresult=linkedList.getLastIndexOf(2);
try{
linkedList.getLastIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -250,6 +349,14 @@ Obtains the index of the first occurrence of the specified element in this conta
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -262,6 +369,11 @@ linkedList.add(1);
linkedList.add(2);
linkedList.add(4);
letresult=linkedList.getIndexOf(2);
try{
linkedList.getIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -284,6 +396,15 @@ Removes an element at the specified position from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeByIndex method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -294,6 +415,16 @@ linkedList.add(5);
linkedList.add(2);
linkedList.add(4);
letresult=linkedList.removeByIndex(2);
try{
linkedList.removeByIndex.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
linkedList.removeFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
linkedList.removeLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -368,6 +537,14 @@ Removes the first occurrence of the specified element from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -377,6 +554,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
letresult=linkedList.remove(2);
try{
linkedList.remove.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
linkedList.removeFirstFound.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
linkedList.removeLastFound.bind({},4)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -455,6 +675,14 @@ Clones this container and returns a copy. The modification to the copy does not
| -------- | -------- |
| LinkedList<T> | New **LinkedList** instance obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clone method cannot be bound. |
**Example**
```ts
...
...
@@ -464,6 +692,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
letresult=linkedList.clone();
try{
linkedList.clone.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -520,6 +776,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
linkedList.clear();
try{
linkedList.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -543,6 +804,15 @@ Replaces an element at the specified position in this container with a given ele
| -------- | -------- |
| T | New element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The set method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -552,6 +822,16 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
letresult=linkedList.set(2,"b");
try{
linkedList.set.bind({},2,"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -568,6 +848,14 @@ Converts this container into an array.
| -------- | -------- |
| Array<T> | Array obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The convertToArray method cannot be bound. |
**Example**
```ts
letlinkedList=newLinkedList();
...
...
@@ -576,6 +864,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
letresult=linkedList.convertToArray();
try{
linkedList.convertToArray.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -592,6 +885,14 @@ Obtains the first element in this container.
| -------- | -------- |
| T | Returns the element if obtained; returns **undefined** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -601,6 +902,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
letresult=linkedList.getFirst();
try{
linkedList.getFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -617,6 +923,14 @@ Obtains the last element in this container.
| -------- | -------- |
| T | Returns the element if obtained; returns **undefined** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLast method cannot be bound. |
**Example**
```ts
...
...
@@ -626,6 +940,11 @@ linkedList.add(4);
linkedList.add(5);
linkedList.add(4);
linkedList.getLast();
try{
linkedList.getLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -642,6 +961,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -663,4 +990,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
linkedList[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -67,16 +79,30 @@ Adds an element at the end of this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
letlist=newList();
letresult=list.add("a");
letresult1=list.add(1);
letresult1=list.add("a");
letresult2=list.add(1);
letb=[1,2,3];
list.add(b);
letresult3=list.add(b);
letc={name:"Dylon",age:"13"};
letresult3=list.add(false);
letresult4=list.add(c);
letresult5=list.add(false);
try{
list.add.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -94,6 +120,15 @@ Inserts an element at the specified position in this container.
| element | T | Yes| Target element.|
| index | number | Yes| Index of the position where the element is to be inserted.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The insert method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -101,6 +136,16 @@ let list = new List();
list.insert("A",0);
list.insert(0,1);
list.insert(true,2);
try{
list.insert.bind({},"b",3)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -123,6 +168,14 @@ Checks whether this container has the specified element.
| -------- | -------- |
| boolean | Returns **true** if the specified element is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -130,6 +183,11 @@ let list = new List();
letresult=list.has("squirrel");
list.add("squirrel");
letresult1=list.has("squirrel");
try{
list.has.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -152,6 +210,14 @@ Obtains the element at the specified position in this container.
| -------- | -------- |
| T | Element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The get method cannot be bound. |
**Example**
```ts
...
...
@@ -164,6 +230,11 @@ list.add(1);
list.add(2);
list.add(4);
letresult=list.get(2);
try{
list.get.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -186,6 +257,14 @@ Obtains the index of the last occurrence of the specified element in this contai
| -------- | -------- |
| number | Returns the index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLastIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -198,6 +277,11 @@ list.add(1);
list.add(2);
list.add(4);
letresult=list.getLastIndexOf(2);
try{
list.getLastIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -220,6 +304,14 @@ Obtains the index of the first occurrence of the specified element in this conta
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOf method cannot be bound. |
**Example**
```ts
...
...
@@ -233,6 +325,11 @@ list.add(2);
list.add(4);
list.getIndexOf(2);
letresult=list.getIndexOf(2);
try{
list.getIndexOf.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -255,6 +352,14 @@ Compares whether a specified object is equal to this container.
| -------- | -------- |
| boolean | Returns **true** if the two are equal; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The equal method cannot be bound. |
**Example**
```ts
...
...
@@ -270,6 +375,11 @@ obj1.add(5);
list.equal(obj1);
letobj2={name:"Dylon",age:"13"};
letresult=list.equal(obj2);
try{
list.equal.bind({},obj2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -292,6 +402,15 @@ Removes an element at the specified position from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeByIndex method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -302,6 +421,16 @@ list.add(5);
list.add(2);
list.add(4);
letresult=list.removeByIndex(2);
try{
list.removeByIndex.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -324,6 +453,14 @@ Removes the first occurrence of the specified element from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -333,6 +470,11 @@ list.add(4);
list.add(5);
list.add(4);
letresult=list.remove(2);
try{
list.remove.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The sort method cannot be bound. |
**Example**
```ts
...
...
@@ -444,6 +624,11 @@ list.add(5);
list.add(4);
list.sort((a:number,b:number)=>a-b);
list.sort((a:number,b:number)=>b-a);
try{
list.sort.bind({},(a:number,b:number)=>b-a)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -467,6 +652,15 @@ Obtains elements within a range in this container, including the element at the
| -------- | -------- |
| List<T> | New **List** instance obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getSubList method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -478,6 +672,16 @@ list.add(4);
letresult=list.getSubList(2,4);
letresult1=list.getSubList(4,3);
letresult2=list.getSubList(2,6);
try{
list.getSubList.bind({},2,4)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -497,6 +709,11 @@ list.add(4);
list.add(5);
list.add(4);
list.clear();
try{
list.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -520,6 +737,15 @@ Replaces an element at the specified position in this container with a given ele
| -------- | -------- |
| T | New element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The set method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -529,7 +755,16 @@ list.add(4);
list.add(5);
list.add(4);
list.set(2,"b");
try{
list.set.bind({},3,"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -546,6 +781,14 @@ Converts this container into an array.
| -------- | -------- |
| Array<T> | Array obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The convertToArray method cannot be bound. |
**Example**
```ts
...
...
@@ -555,6 +798,11 @@ list.add(4);
list.add(5);
list.add(4);
letresult=list.convertToArray();
try{
list.convertToArray.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -571,6 +819,14 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
...
...
@@ -580,6 +836,11 @@ list.add(4);
list.add(5);
list.add(4);
letresult=list.isEmpty();
try{
list.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -596,6 +857,14 @@ Obtains the first element in this container.
| -------- | -------- |
| T | The first element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -605,6 +874,11 @@ list.add(4);
list.add(5);
list.add(4);
letresult=list.getFirst();
try{
list.getFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -621,6 +895,14 @@ Obtains the last element in this container.
| -------- | -------- |
| T | The last element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLast method cannot be bound. |
**Example**
```ts
...
...
@@ -630,6 +912,11 @@ list.add(4);
list.add(5);
list.add(4);
letresult=list.getLast();
try{
list.getLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -646,6 +933,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -667,4 +962,9 @@ while(temp != undefined) {
console.log("value: "+temp);
temp=iter.next().value;
}
try{
list[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
**PlainArray** stores key-value (KV) pairs. Each key must be unique, be of the number type, and have only one value.
**PlainArray** is based on generics and uses a lightweight structure. Keys in the array are searched using binary search, which map to values in other arrays.
**PlainArray** is based on generics and uses a lightweight structure. Keys in the array are searched using binary search and are mapped to values in other arrays.
Both **PlainArray** and **[LightWeightMap](js-apis-lightweightmap.md)** are used to store KV pairs in the lightweight structure. However, the key type of **PlainArray** can only be **number**.
...
...
@@ -42,10 +42,23 @@ A constructor used to create a **PlainArray** instance.
@@ -63,11 +76,24 @@ Checks whether this container is empty.
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
constplainArray=newPlainArray();
letresult=plainArray.isEmpty();
try{
plainArray.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -91,6 +117,14 @@ Checks whether this container contains the specified key.
| -------- | -------- |
| boolean | Returns **true** if the specified key is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -98,6 +132,11 @@ let plainArray = new PlainArray();
plainArray.has(1);
plainArray.add(1,"squirrel");
letresult1=plainArray.has(1);
try{
plainArray.has.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -121,6 +160,14 @@ Obtains the value of the specified key in this container.
| -------- | -------- |
| T | Value of the key.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The get method cannot be bound. |
**Example**
```ts
...
...
@@ -128,6 +175,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.get(1);
try{
plainArray.get.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -151,6 +203,14 @@ Obtains the index of the first occurrence of an element with the specified key i
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOfKey method cannot be bound. |
**Example**
```ts
...
...
@@ -158,6 +218,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.getIndexOfKey(2);
try{
plainArray.getIndexOfKey.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -181,6 +246,14 @@ Obtains the index of the first occurrence of an element with the specified value
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getIndexOfValue method cannot be bound. |
**Example**
```ts
...
...
@@ -188,6 +261,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.getIndexOfValue("squirrel");
try{
plainArray.getIndexOfValue.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -211,6 +289,14 @@ Obtains the key of the element at the specified position in this container.
| -------- | -------- |
| number | Returns the key of the element if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getKeyAt method cannot be bound. |
**Example**
```ts
...
...
@@ -218,6 +304,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.getKeyAt(1);
try{
plainArray.getKeyAt.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -240,14 +331,33 @@ Obtains the value of an element at the specified position in this container.
| -------- | -------- |
| T | Returns the value of the element if obtained; returns **undefined** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getValueAt method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
letplainArray=newPlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.getKeyAt(1);
```
```ts
letplainArray=newPlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.getValueAt(1);
try{
plainArray.getValueAt.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -263,6 +373,14 @@ Clones this container and returns a copy. The modification to the copy does not
| -------- | -------- |
| PlainArray<T> | New **PlainArray** instance obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clone method cannot be bound. |
**Example**
```ts
...
...
@@ -270,6 +388,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letnewPlainArray=plainArray.clone();
try{
plainArray.clone.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -288,11 +411,24 @@ Adds an element to this container.
| key | number | Yes| Key of the target element.|
| value | T | Yes| Value of the target element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
letplainArray=newPlainArray();
plainArray.add(1,"squirrel");
try{
plainArray.add.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -316,14 +452,26 @@ Removes an element with the specified key from this container.
| -------- | -------- |
| T | Value of the element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
letplainArray=newPlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
plainArray.remove(2);
letresult=plainArray.remove(2);
try{
plainArray.remove.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -347,14 +495,26 @@ Removes an element at the specified position from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeAt method cannot be bound. |
**Example**
```ts
letplainArray=newPlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
plainArray.removeAt(1);
letresult=plainArray.removeAt(1);
try{
plainArray.removeAt.bind({},1)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -379,6 +539,15 @@ Removes elements in a specified range from this container.
| -------- | -------- |
| number | Number of elements removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The removeRangeFrom method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -386,6 +555,16 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.removeRangeFrom(1,3);
try{
plainArray.removeRangeFrom.bind({},1,3)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -404,6 +583,15 @@ Sets a value for an element at the specified position in this container.
| index | number | Yes| Position index of the target element.|
| value | T | Yes| Value of the target element.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The setValueAt method cannot be bound. |
| 10200001 | The value of parameters are out of range. |
**Example**
```ts
...
...
@@ -411,6 +599,16 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
plainArray.setValueAt(1,3546);
try{
plainArray.setValueAt.bind({},1,3546)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -428,6 +626,14 @@ Obtains a string that contains all elements in this container.
| -------- | -------- |
| String | String obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The toString method cannot be bound. |
**Example**
```ts
...
...
@@ -435,6 +641,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
letresult=plainArray.toString();
try{
plainArray.toString.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -453,6 +672,11 @@ let plainArray = new PlainArray();
plainArray.add(1,"squirrel");
plainArray.add(2,"sparrow");
plainArray.clear();
try{
plainArray.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -525,4 +772,9 @@ while(temp != undefined) {
console.log("value:"+temp[1]);
temp=iter.next().value;
}
try{
plainArray[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -66,17 +79,29 @@ Adds an element at the end of this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
letqueue=newQueue();
letresult=queue.add("a");
letresult1=queue.add(1);
queue.add(1);
letb=[1,2,3];
queue.add(b);
letresult2=queue.add(b);
letc={name:"Dylon",age:"13"};
letresult3=queue.add(c);
try{
queue.add.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -93,6 +118,14 @@ Removes the first element from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The pop method cannot be bound. |
**Example**
```ts
...
...
@@ -103,6 +136,11 @@ queue.add(5);
queue.add(2);
queue.add(4);
letresult=queue.pop();
try{
queue.pop.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -119,6 +157,14 @@ Obtains the first element of this container.
| -------- | -------- |
| T | The first element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -128,6 +174,11 @@ queue.add(4);
queue.add(5);
queue.add(2);
letresult=queue.getFirst();
try{
queue.getFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -182,8 +247,15 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Example**
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
letqueue=newQueue();
queue.add(2);
...
...
@@ -203,4 +275,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
queue[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -68,6 +81,14 @@ Adds an element at the top of this container.
| -------- | -------- |
| T | Element added.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The push method cannot be bound. |
**Example**
```ts
...
...
@@ -75,9 +96,14 @@ let stack = new Stack();
letresult=stack.push("a");
letresult1=stack.push(1);
letb=[1,2,3];
stack.push(b);
letresult2=stack.push(b);
letc={name:"Dylon",age:"13"};
letresult3=stack.push(c);
try{
stack.push.bind({},"b")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -94,6 +120,14 @@ Removes the top element from this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The pop method cannot be bound. |
**Example**
```ts
...
...
@@ -104,6 +138,11 @@ stack.push(5);
stack.push(2);
stack.push(4);
letresult=stack.pop();
try{
stack.pop.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -120,6 +159,14 @@ Obtains the top element of this container.
| -------- | -------- |
| T | Element obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The peek method cannot be bound. |
**Example**
```ts
...
...
@@ -129,6 +176,11 @@ stack.push(4);
stack.push(5);
stack.push(2);
letresult=stack.peek();
try{
stack.peek.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -151,6 +203,14 @@ Obtains the index of the first occurrence of the specified element in this conta
| -------- | -------- |
| number | Returns the position index if obtained; returns **-1** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The locate method cannot be bound. |
**Example**
```ts
...
...
@@ -160,6 +220,11 @@ stack.push(4);
stack.push(5);
stack.push(2);
letresult=stack.locate(2);
try{
stack.locate.bind({},2)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -213,6 +293,14 @@ Checks whether this container is empty (contains no elements).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
...
...
@@ -222,6 +310,11 @@ stack.push(4);
stack.push(5);
stack.push(4);
letresult=stack.isEmpty();
try{
stack.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -238,6 +331,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
letstack=newStack();
...
...
@@ -258,4 +359,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
stack[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -65,11 +78,24 @@ Checks whether this container is empty (contains no element).
| -------- | -------- |
| boolean | Returns **true** if the container is empty; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The isEmpty method cannot be bound. |
**Example**
```ts
consttreeSet=newTreeSet();
letresult=treeSet.isEmpty();
try{
treeSet.isEmpty.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -93,6 +119,14 @@ Checks whether this container has the specified value.
| -------- | -------- |
| boolean | Returns **true** if the specified value is contained; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The has method cannot be bound. |
**Example**
```ts
...
...
@@ -100,6 +134,11 @@ let treeSet = new TreeSet();
treeSet.has(123);
treeSet.add(123);
letresult1=treeSet.has(123);
try{
treeSet.has.bind({},123)();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -117,6 +156,14 @@ Obtains the value of the first element in this container.
| -------- | -------- |
| T | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getFirstValue method cannot be bound. |
**Example**
```ts
...
...
@@ -124,6 +171,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
letresult=treeSet.getFirstValue();
try{
treeSet.getFirstValue.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -141,6 +193,14 @@ Obtains the value of the last element in this container.
| -------- | -------- |
| T | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLastValue method cannot be bound. |
**Example**
```ts
...
...
@@ -148,6 +208,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
letresult=treeSet.getLastValue();
try{
treeSet.getLastValue.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -171,11 +236,24 @@ Adds an element to this container.
| -------- | -------- |
| boolean | Returns **true** if the element is added successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The add method cannot be bound. |
**Example**
```ts
lettreeSet=newTreeSet();
letresult=treeSet.add("squirrel");
try{
treeSet.add.bind({},"squirrel")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -199,6 +277,14 @@ Removes the element with the specified key from this container.
| -------- | -------- |
| boolean | Returns **true** if the element is removed successfully; returns **false** otherwise.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The remove method cannot be bound. |
**Example**
```ts
...
...
@@ -206,6 +292,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
letresult=treeSet.remove("sparrow");
try{
treeSet.remove.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -229,6 +320,14 @@ Obtains the value that is placed in front of the input key in this container.
| -------- | -------- |
| T | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getLowerValue method cannot be bound. |
**Example**
```ts
...
...
@@ -237,6 +336,11 @@ treeSet.add("squirrel");
treeSet.add("sparrow");
treeSet.add("gander");
letresult=treeSet.getLowerValue("sparrow");
try{
treeSet.getLowerValue.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -260,6 +364,14 @@ Obtains the value that is placed next to the input key in this container.
| -------- | -------- |
| T | Value obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The getHigherValue method cannot be bound. |
**Example**
```ts
...
...
@@ -268,6 +380,11 @@ treeSet.add("squirrel");
treeSet.add("sparrow");
treeSet.add("gander");
letresult=treeSet.getHigherValue("sparrow");
try{
treeSet.getHigherValue.bind({},"sparrow")();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -285,6 +402,14 @@ Removes the first element in this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The popFirst method cannot be bound. |
**Example**
```ts
...
...
@@ -292,6 +417,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
letresult=treeSet.popFirst();
try{
treeSet.popFirst.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -309,6 +439,14 @@ Removes the last element in this container.
| -------- | -------- |
| T | Element removed.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The popLast method cannot be bound. |
**Example**
```ts
...
...
@@ -316,6 +454,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
letresult=treeSet.popLast();
try{
treeSet.popLast.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The clear method cannot be bound. |
**Example**
```ts
...
...
@@ -334,6 +485,11 @@ let treeSet = new TreeSet();
treeSet.add("squirrel");
treeSet.add("sparrow");
treeSet.clear();
try{
treeSet.clear.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -351,6 +507,14 @@ Obtains an iterator that contains all the values in this container.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The values method cannot be bound. |
**Example**
```ts
...
...
@@ -362,7 +526,12 @@ let temp = iter.next().value;
while(temp!=undefined){
console.log("value:"+temp);
temp=iter.next().value;
}
}
try{
treeSet.values.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -414,6 +598,14 @@ Obtains an iterator that contains all the elements in this container.
| -------- | -------- |
| IterableIterator<[T,T]> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The entries method cannot be bound. |
**Example**
```ts
...
...
@@ -427,6 +619,11 @@ while(temp != undefined) {
console.log("value:"+temp[1]);
temp=iter.next().value;
}
try{
treeSet.entries.bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.
@@ -444,6 +641,14 @@ Obtains an iterator, each item of which is a JavaScript object.
| -------- | -------- |
| IterableIterator<T> | Iterator obtained.|
**Error codes**
For details about the error codes, see [containers Error Codes](../errorcodes/errorcode-containers.md).
| ID| Error Message|
| -------- | -------- |
| 10200011 | The Symbol.iterator method cannot be bound. |
**Example**
```ts
...
...
@@ -463,4 +668,9 @@ while(temp != undefined) {
console.log("value:"+temp);
temp=iter.next().value;
}
try{
treeSet[Symbol.iterator].bind({})();// bind() creates a new bound function that, when called, has its this keyword set to the provided value. It is used to test exception capture.