| /arkcompiler/runtime_core/static_core/plugins/ets/sdk/api/ |
| D | @ohos.util.LinkedList.ets | 20 element: T; 24 constructor(element: T) { 25 this.element = element; 43 let element = this.node!.element; 45 return new IteratorResult<T>(element); 75 * Adds an element to the end of the list. 76 * @param element The element to add. 77 * @returns True if the element was added successfully. 79 public add(element: T): boolean { 80 this.insert(this.elementNum, element); [all …]
|
| D | @ohos.util.List.ets | 38 * Adds an element to the end of the list. 40 * @param element The element to add. 41 * @returns True if the element was added successfully. 43 public add(element: T): boolean { 44 return this.buffer.add(element); 75 let element = iterator.next(); 77 while (!element.done && currentNode !== undefined) { 78 if (currentNode!.element !== element.value!) { 82 element = iterator.next(); 86 if (element.done && currentNode === undefined) { [all …]
|
| D | @ohos.util.Stack.ets | 27 * Retrieves the top element in the Stack without removing it. 28 * @returns The top element in the Stack, or undefined if the Stack is empty. 35 * Finds the index of the specified element in the Stack. 36 * @param element - The element to locate in the Stack. 37 * @returns The index of the element if found, otherwise -1. 39 public locate(element: T): number { 40 return this.buffer.findIndex((val) => val == element); 44 * Removes and returns the first element in the Stack. 45 * @returns The first element in the Stack, or undefined if the Stack is empty. 59 * Executes a provided function once for each array element. [all …]
|
| D | @ohos.util.Deque.ets | 53 * Returns the first element of the deque without removing it. 55 …* @returns {T | undefined} The first element of the deque if it exists, otherwise `undefined` if t… 66 * Returns the last element of the deque without removing it. 68 …* @returns {T | undefined} The last element of the deque if it exists, otherwise `undefined` if th… 79 * Removes and returns the first element from the deque. 81 …* @returns {T | undefined} The first element of the deque if it exists, otherwise `undefined` if t… 95 * Removes and returns the last element from the deque. 97 …* @returns {T | undefined} The last element of the deque if it exists, otherwise `undefined` if th… 105 let element: T = this.buffer[this.rear]; 107 return element; [all …]
|
| D | @ohos.util.Queue.ets | 29 * Retrieves the first element in the Queue without removing it. 30 * @returns The first element in the Queue, or undefined if the Queue is empty. 37 * Removes and returns the first element in the Queue. 38 * @returns The first element in the Queue, or undefined if the Queue is empty. 52 * Executes a provided function once for each array element. 54 …* @param callbackfn - The function to execute on each element, taking the value, index, and Queue … 61 * Adds an element to the end of the Queue. 62 * @param element - The element to add. 64 * @returns Returns true if the element is added successfully; returns false otherwise. 66 public add(element: T): boolean { [all …]
|
| D | @ohos.util.ArrayList.ets | 63 * @param element - the added element. 67 public add(element: T): boolean { 75 this.buffer.push(element); 82 * @param element - the added element. 86 public insert(element: T, index: number): void { 91 this.buffer.push(element); // length++ 95 this.buffer[index.toInt()] = element; 104 newBuffer.push(element); 114 * Check whether the specified element is contained in the ArrayList. 116 * @param element - the specified element. [all …]
|
| D | @ohos.util.TreeSet.ets | 119 * Add a new element into the TreeSet 123 * @returns true if the element is successfully added into the TreeSet 142 * Return the value of the first element in the TreeSet 144 * @returns the value of the first element if exists 151 * Return the higher value of the given key's element in the TreeSet 153 * @param key: the key of the element which will be get the higher value 155 * @returns the higher value of the given key's element if exists or undefined 162 * Return the value of the last element in the TreeSet 164 * @returns the value of the last element if exists 171 * Return the lower value of the given key's element in the TreeSet [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/templates/stdlib/ |
| D | typedUArray.ets.j2 | 22 {%- for element in [{'name': 'Uint8Clamped', 'subsetType': 'number', 'subsetTypeValues': 'Number', … 27 …element.update({'subsetTypeBoxed': element['subsetType'][0].upper() + element['subsetType'][1:], … 28 …{%- set asElementCompat = ('%s as ' + element['subsetType']) if element['subsetType'] != 'BigInt' … 29 …{%- set fromElementCompat = ('%s as ' + element['primitiveType']) if element['subsetType'] != 'Big… 30 …{%- set numberBigIntToPrimitive = ('.' + element['primitiveType'] + 'Value()') if element['subsetT… 32 …{%- set isNonCompat = '/* public */ internal' if element['subsetType'] != 'BigInt' else 'private' … 33 …{%- set valueOrBigIntGetULong = '%s' if element['subsetType'] != 'BigInt' else 'new BigInt(%s).get… 34 …{%- set asElementCompatOrBigInt = ('%s as ' + element['primitiveType']) if element['subsetType'] !… 36 class {{element['name']}}ArrayIteratorKeys implements IterableIterator<number> { 40 constructor(parent: {{element['name']}}Array) { [all …]
|
| /arkcompiler/ets_runtime/test/moduletest/arrayfindlast/ |
| D | arrayfindlast.js | 25 result = arr.findLast((element, index, array) => { 27 return (element == 5); 30 result = arr.findLast((element) => { 31 return element > 2; 35 result = arr.findLastIndex((element, index, array) => { 39 return (element == 100); 42 result = arr.findLastIndex((element, index, array) => { 43 return (element == 100); 48 result = arr2.findLast((element, index, array) => { 49 return (element == undefined); [all …]
|
| /arkcompiler/ets_frontend/es2panda/compiler/base/ |
| D | destructuring.cpp | 40 // create left reference for rest element in GenRestElement() 80 for (const auto *element : array->Elements()) { in GenArray() local 83 if (element->IsRestElement()) { in GenArray() 84 GenRestElement(pg, element->AsRestElement(), iterator, array->IsDeclaration()); in GenArray() 89 if (element->IsOmittedExpression()) { in GenArray() 95 const ir::Expression *target = element; in GenArray() 97 if (element->IsAssignmentPattern() || element->IsAssignmentExpression()) { in GenArray() 98 auto *assignment = element->IsAssignmentPattern() ? element->AsAssignmentPattern() : in GenArray() 99 element->AsAssignmentExpression(); in GenArray() 110 pg->BranchIfStrictUndefined(element, defaultInit); in GenArray() [all …]
|
| D | literals.cpp | 44 for (const auto *element : templateLit->Quasis()) { in GetTemplateObject() local 45 pg->LoadAccumulatorInt(element, elemIndex); in GetTemplateObject() 46 pg->StoreAccumulator(element, indexReg); in GetTemplateObject() 48 pg->LoadAccumulatorString(element, element->Raw()); in GetTemplateObject() 49 pg->DefineFieldByValue(element, rawArr, indexReg); in GetTemplateObject() 50 // Generate ldundefined when element is escape error in GetTemplateObject() 51 if (element->EscapeError()) { in GetTemplateObject() 52 pg->LoadConst(element, compiler::Constant::JS_UNDEFINED); in GetTemplateObject() 54 pg->LoadAccumulatorString(element, element->Cooked()); in GetTemplateObject() 56 pg->DefineFieldByValue(element, cookedArr, indexReg); in GetTemplateObject()
|
| /arkcompiler/ets_frontend/ets2panda/compiler/base/ |
| D | destructuring.cpp | 42 // create left reference for rest element in GenRestElement() 73 for (const auto *element : array->Elements()) { in GenElement() local 76 if (element->IsRestElement()) { in GenElement() 77 GenRestElement(pg, element->AsRestElement(), iterator, array->IsDeclaration()); in GenElement() 82 if (element->IsOmittedExpression()) { in GenElement() 88 const ir::Expression *target = element; in GenElement() 90 if (element->IsAssignmentPattern()) { in GenElement() 91 target = element->AsAssignmentPattern()->Left(); in GenElement() 92 init = element->AsAssignmentPattern()->Right(); in GenElement() 101 pg->BranchIfUndefined(element, defaultInit); in GenElement() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/std/core/ |
| D | Json.ets | 53 * Error thrown when attempting to access a JSON element with an incompatible type. 54 * For example, trying to get a string value from a number element. 88 * Core class representing a JSON element that can hold any valid JSON value. 96 * const element = new JsonElement(); 97 * element.setString("Hello"); 98 * console.log(element.asString()); // "Hello" 151 * Gets the type of the JSON element. 180 * Gets the key associated with this JSON element. 181 * @returns {string} The key of this element 188 * Gets a JSON element from an array by index. [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/std/containers/ |
| D | BlockingQueue.ets | 23 * Inserts element at the end. If the queue is full, blocking. 25 * @param element the element pushed to the BlockingQueue 29 push(element: T): void; 35 * @returns T The first element. 42 * @param element the element inserted to the BlockingQueue 46 add(element: T): boolean; 49 * The poll operation. Pop one element and return it if the queue is not empty. 52 * @returns Return the deleted element or null. 57 * Returns the first element in a BlockingQueue. 59 * @returns T | null The first element or null.
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/LinkedList/ |
| D | LinkedListInsertHasGetTest.ets | 21 …suite.addTest("LinkedList insert an element within the container's length range", testInsertWithin… 22 …suite.addTest("LinkedList insert an element at the boundary of the container", testInsertAtBoundar… 27 suite.addTest("LinkedList has an element in the container", testHasElementInContainer); 28 suite.addTest("LinkedList has an element not in the container", testHasElementNotInContainer); 72 assertEQ(linkedList.get(0), TestData.testNumber1, "Element at index 0 should match"); 73 …assertEQ(linkedList.get(TestData.testNumber1), TestData.testNumber1, "Element at index 6 should ma… 74 …assertEQ(linkedList.get(TestData.testNumber2), TestData.testString1, "Element at index 1 should ma… 75 assertEQ(linkedList.get(TestData.testNumber3), true, "Element at index 2 should match"); 76 assertEQ(linkedList.get(TestData.testNumber4), null, "Element at index 3 should match"); 77 …assertEQ(linkedList.get(TestData.testNumber5), TestData.testObject1, "Element at index 4 should ma… [all …]
|
| D | LinkedListRemoveFoundTests.ets | 21 …suite.addTest("LinkedList removeFirstFound with an unique element", testRemoveFirstFoundUniqueElem… 22 …suite.addTest("LinkedList removeFirstFound with an inexistent element", testRemoveFirstFoundInexis… 23 …suite.addTest("LinkedList removeFirstFound with a repeated element", testRemoveFirstFoundRepeatedE… 24 …suite.addTest("LinkedList removeLastFound with an unique element", testRemoveLastFoundUniqueElemen… 25 …suite.addTest("LinkedList removeLastFound with an inexistent element", testRemoveLastFoundInexiste… 28 …suite.addTest("LinkedList removeLastFound with a repeated element", testRemoveLastFoundRepeatedEle… 56 …assertTrue(linkedList.removeFirstFound(TestData.testNumber1), "First found element 1 should be rem… 58 …assertEQ(linkedList.get(i), TestData.arrayForNumber3[i + TestData.testNumber1], "Element should ma… 66 assertFalse(linkedList.removeFirstFound(TestData.testNumber6), "Element 6 is inexistent"); 68 assertEQ(linkedList.get(i), TestData.arrayForNumber3[i], "Element should match"); [all …]
|
| D | LinkedListRemoveByIndexTests.ets | 28 …suite.addTest("LinkedList remove the first element from an empty container", testRemoveFirstFromEm… 29 suite.addTest("LinkedList remove the first element from a non-empty container", 31 …suite.addTest("LinkedList remove the last element from an empty container", testRemoveLastFromEmpt… 32 …suite.addTest("LinkedList remove the last element from a non-empty container", testRemoveLastFromN… 33 suite.addTest("LinkedList remove an unique element", testRemoveUniqueElement); 34 suite.addTest("LinkedList remove an inexistent element", testRemoveInexistentElement); 35 suite.addTest("LinkedList remove a repeated element", testRemoveRepeatedElement); 63 …assertEQ(linkedList.removeByIndex(TestData.testNumber1), TestData.testNumber1, "Removed element sh… 64 assertEQ(linkedList.get(0), 0, "Element at index 0 should be 0"); 66 …assertEQ(linkedList.get(i), TestData.arrayForNumber1[i + TestData.testNumber1], "Element should ma… [all …]
|
| /arkcompiler/runtime_core/libpandabase/utils/ |
| D | ring_buffer.h | 145 * Appends the given element value to the end of the ring buffer 146 * @param value the value of the element to append 155 * Moves the given element value to the end of the ring buffer 156 * @param value the value of the element to append 164 * Appends a new element to the end of the ring buffer 167 * @param args arguments to forward to the constructor of the element 168 * @return a reference to the inserted element 179 * Appends the given element value to the begin of the ring buffer 180 * @param value the value of the element to append 189 * Moves the given element value to the begin of the ring buffer [all …]
|
| /arkcompiler/runtime_core/static_core/libpandabase/utils/ |
| D | ring_buffer.h | 149 * Appends the given element value to the end of the ring buffer 150 * @param value the value of the element to append 159 * Moves the given element value to the end of the ring buffer 160 * @param value the value of the element to append 168 * Appends a new element to the end of the ring buffer 171 * @param args arguments to forward to the constructor of the element 172 * @return a reference to the inserted element 183 * Appends the given element value to the begin of the ring buffer 184 * @param value the value of the element to append 193 * Moves the given element value to the begin of the ring buffer [all …]
|
| /arkcompiler/ets_runtime/test/moduletest/typedarrayfindlast/ |
| D | typedarrayfindlast.js | 79 let result1 = obj.findLast((element, index, array) => { 80 return (element == 12); 83 result1 = obj.findLast((element, index, array) => { 84 return (element < 10); 87 result1 = obj.findLastIndex((element, index, array) => { 91 return (element == 100); 94 result1 = obj.findLastIndex((element, index, array) => { 95 return (element == 100); 109 let result1 = obj.findLast((element, index, array) => { 110 return (element == 12n); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/List/ |
| D | ListHasGetGetLastIndexOfTests.ets | 21 suite.addTest("List has an element in the container", testHasElementInContainer); 22 suite.addTest("List has an element not in the container", testHasElementNotInContainer); 26 suite.addTest("List getLastIndexOf an unique element", testGetLastIndexOfUniqueElement); 27 suite.addTest("List getLastIndexOf an inexistent element", testGetLastIndexOfInexistentElement); 29 suite.addTest("List getLastIndexOf a repeated element", testGetLastIndexOfRepeatedElement); 61 assertEQ(value, TestData.arrayForNumber1[i++], "The element should be present"); 69 assertEQ(list.getLast(), TestData.testString2, "The element should be present"); 71 assertEQ(list.getLast(), TestData.testString1, "The element should be present"); 73 assertEQ(list.getLast(), TestData.testNumber1, "The element should be present"); 75 assertEQ(list.getLast(), null, "The element should be present"); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/runtime/intrinsics/ |
| D | escompat_Array.cpp | 87 auto element = buffer->Get(index); in EtsEscompatArrayIndexOfString() local 88 if (element != nullptr && element->IsStringClass() && in EtsEscompatArrayIndexOfString() 89 valueString->Compare(coretypes::String::Cast(element->GetCoreType())) == 0) { in EtsEscompatArrayIndexOfString() 100 auto element = buffer->Get(index); in EtsEscompatArrayLastIndexOfString() local 101 if (element != nullptr && element->IsStringClass() && in EtsEscompatArrayLastIndexOfString() 102 valueString->Compare(coretypes::String::Cast(element->GetCoreType())) == 0) { in EtsEscompatArrayLastIndexOfString() 114 auto element = buffer->Get(index); in EtsEscompatArrayIndexOfEnum() local 115 auto elementClass = element->GetClass(); in EtsEscompatArrayIndexOfEnum() 117 auto *elementEnum = EtsBaseEnum::FromEtsObject(element)->GetValue(); in EtsEscompatArrayIndexOfEnum() 131 auto element = buffer->Get(index); in EtsEscompatArrayLastIndexOfEnum() local [all …]
|
| /arkcompiler/runtime_core/static_core/runtime/include/ |
| D | histogram-inl.h | 46 void SimpleHistogram<Value>::AddValue(const Value &element, size_t number) in AddValue() argument 48 sum_ += element * Value(number); in AddValue() 49 sumOfSquares_ += element * element * Value(number); in AddValue() 51 min_ = element; in AddValue() 52 max_ = element; in AddValue() 54 min_ = std::min(min_, element); in AddValue() 55 max_ = std::max(max_, element); in AddValue() 89 void Histogram<Value>::AddValue(const Value &element, size_t number) in AddValue() argument 91 frequency_[element] += number; in AddValue() 92 SimpleHistogram<Value>::AddValue(element, number); in AddValue()
|
| /arkcompiler/ets_frontend/ets2panda/test/ast/compiler/ets/FixedArray/annotation_tests/ |
| D | annotationDecl_bad_initializer08.ets | 29 … @@? 22:39 Error TypeError: Array element at index 0 with type 'double' is not compatible with the… 30 … @@? 22:44 Error TypeError: Array element at index 1 with type 'double' is not compatible with the… 32 … @@? 24:40 Error TypeError: Array element at index 0 with type 'Color' is not compatible with the … 33 … @@? 24:53 Error TypeError: Array element at index 1 with type 'Color' is not compatible with the …
|
| /arkcompiler/ets_frontend/ets2panda/test/ast/compiler/ets/annotation_tests/ |
| D | annotationDecl_bad_initializer08.ets | 29 … @@? 22:29 Error TypeError: Array element at index 0 with type 'double' is not compatible with the… 30 … @@? 22:34 Error TypeError: Array element at index 1 with type 'double' is not compatible with the… 32 … @@? 24:30 Error TypeError: Array element at index 0 with type 'Color' is not compatible with the … 33 … @@? 24:43 Error TypeError: Array element at index 1 with type 'Color' is not compatible with the …
|