|
| 1 | +--- |
| 2 | +title: CSVArrayList |
| 3 | +parent: API |
| 4 | +nav_order: 5 |
| 5 | +--- |
| 6 | + |
| 7 | +# CSVArrayList |
| 8 | +{: .d-inline-block } |
| 9 | + |
| 10 | +New |
| 11 | +{: .label .label-purple } |
| 12 | + |
| 13 | +Class module developed to emulate some functionalities from the `ArrayList` present in some most modern languages. The `CSVArrayList` serve as a container for all the data read from CSV files and can be used to manipulate the stored items, or to store data that does not come from a CSV file, according to the user's request. |
| 14 | +{: .fs-4 .fw-300 } |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Members |
| 19 | + |
| 20 | +<table> |
| 21 | +<thead> |
| 22 | +<tr> |
| 23 | +<th style="text-align: left;">Item</th> |
| 24 | +<th style="text-align: left;">Type</th> |
| 25 | +<th style="text-align: left;">Description</th> |
| 26 | +</tr> |
| 27 | +</thead> |
| 28 | +<tbody> |
| 29 | +<tr> |
| 30 | +<td style="text-align: left; color:blue;"><em>Add</em></td> |
| 31 | +<td style="text-align: left;">Method</td> |
| 32 | +<td style="text-align: left;">Appends a copy of the specified value to the current instance. Given the nature adopted by the CSV interface to store data, if the value to be appended to the current instance is not a one-dimensional array, where each element represents a field, the user will not be able to use data sorting methods properly. User must use the <code>Add2</code> method instead if the goal is to sort stored items.</td> |
| 33 | +</tr> |
| 34 | +<tr> |
| 35 | +<td style="text-align: left; color:blue;"><em>Add2</em></td> |
| 36 | +<td style="text-align: left;">Method</td> |
| 37 | +<td style="text-align: left;">Appends a copy of the specified values to the current instance. In contrast to the <code>Add</code> method, the data is operated on before being stored, so if the values to be appended to the current instance are not one-dimensional arrays, they will be properly stored as one-dimensional array. In this way, the user will be able to use the data sorting methods provided by the class as long as no multi-dimensional arrays are stored in the current instance.</td> |
| 38 | +</tr> |
| 39 | +<tr> |
| 40 | +<td style="text-align: left; color:blue;"><em>Clear</em></td> |
| 41 | +<td style="text-align: left;">Method</td> |
| 42 | +<td style="text-align: left;">Reinitializes the current instance.</td> |
| 43 | +</tr> |
| 44 | +<tr> |
| 45 | +<td style="text-align: left; color:blue;"><em>Clone</em></td> |
| 46 | +<td style="text-align: left;">Method</td> |
| 47 | +<td style="text-align: left;">Returns a <code>CSVArraylist</code> as a exact copy of the current instance.</td> |
| 48 | +</tr> |
| 49 | +<tr> |
| 50 | +<td style="text-align: left; color:blue;"><em>Concat</em></td> |
| 51 | +<td style="text-align: left;">Method</td> |
| 52 | +<td style="text-align: left;">Concatenates the values from the current instance with the specified values and returns a <code>CSVArraylist</code> object as result. The <code>AValues</code> parameter is a <code>Variant</code> data type containing the array, <code>CSVArraylist</code> or value to concatenate.</td> |
| 53 | +</tr> |
| 54 | +<tr> |
| 55 | +<td style="text-align: left; color:blue;"><em>Copy</em></td> |
| 56 | +<td style="text-align: left;">Method</td> |
| 57 | +<td style="text-align: left;">Returns a <code>CSVArraylist</code> object with a copy of the current instance from and to a given index. The <code>StartIndex</code> parameter indicates where the copy will start and the <code>EndIndex</code> determines where the operation will end. If the <code>EndIndex</code> parameter is set to <code>-1</code>, the operation will end at the maximum index available for the current instance.</td> |
| 58 | +</tr> |
| 59 | +<tr> |
| 60 | +<td style="text-align: left; color:blue;"><em>CopyToArray</em></td> |
| 61 | +<td style="text-align: left;">Method</td> |
| 62 | +<td style="text-align: left;">Returns an array with a copy of the current instance from and to a given index. The <code>StartIndex</code> parameter indicates where the copy will start and the <code>EndIndex</code> determines where the operation will end. If the <code>EndIndex</code> parameter is set to <code>-1</code>, the operation will end at the maximum index available for the current instance.</td> |
| 63 | +</tr> |
| 64 | +<tr> |
| 65 | +<td style="text-align: left; color:blue;"><em>count</em></td> |
| 66 | +<td style="text-align: left;">Property</td> |
| 67 | +<td style="text-align: left;">Returns the amount of items stored in the current instance.</td> |
| 68 | +</tr> |
| 69 | +<tr> |
| 70 | +<td style="text-align: left; color:blue;"><em>CreateJagged</em></td> |
| 71 | +<td style="text-align: left;">Method</td> |
| 72 | +<td style="text-align: left;">Creates an empty jagged array. The operation will turns the array <code>ArrVar</code> into an jagged array with <code>ArraySize + 1</code> rows and each row with <code>VectorSize</code> columns. To access to an individual element user must use something like <code>expression(i)(j)</code>, where <code>i</code> denotes an index in the main array and <code>j</code> denotes an index in the child array.</td> |
| 73 | +</tr> |
| 74 | +<tr> |
| 75 | +<td style="text-align: left; color:blue;"><em>Insert</em></td> |
| 76 | +<td style="text-align: left;">Method</td> |
| 77 | +<td style="text-align: left;">Inserts an Item, at the given Index, in the current instance of the class.</td> |
| 78 | +</tr> |
| 79 | +<tr> |
| 80 | +<td style="text-align: left; color:blue;"><em>IsJaggedArray</em></td> |
| 81 | +<td style="text-align: left;">Method</td> |
| 82 | +<td style="text-align: left;">Returns <code>True</code> if the paseed argument is a jagged array.</td> |
| 83 | +</tr> |
| 84 | +<tr> |
| 85 | +<td style="text-align: left; color:blue;"><em>item</em></td> |
| 86 | +<td style="text-align: left;">Property</td> |
| 87 | +<td style="text-align: left;">Gets or sets an Item, by its index, from the current instance. This is the default property, so the user can use abbreviated expressions such as <code>expression(i)</code> to access the Item <code>i</code>, where <code>expression</code> represents a <code>CSVArrayList</code> object.</td> |
| 88 | +</tr> |
| 89 | +<tr> |
| 90 | +<td style="text-align: left; color:blue;"><em>items</em></td> |
| 91 | +<td style="text-align: left;">Property</td> |
| 92 | +<td style="text-align: left;">Gets or sets the collection of elements from or to the current instance. To set the elements, the <code>AValue</code> parameter must be an array.</td> |
| 93 | +</tr> |
| 94 | +<tr> |
| 95 | +<td style="text-align: left; color:blue;"><em>JaggedToTwoDimArray</em></td> |
| 96 | +<td style="text-align: left;">Method</td> |
| 97 | +<td style="text-align: left;">Turns a jagged array into a two dim array. The method will successively deconstruct and delete the jagged array, passing its contents to the specified two-dimensional array.</td> |
| 98 | +</tr> |
| 99 | +<tr> |
| 100 | +<td style="text-align: left; color:blue;"><em>MultiDimensional</em></td> |
| 101 | +<td style="text-align: left;">Method</td> |
| 102 | +<td style="text-align: left;">Checks if an array has more than one dimension and returns <code>True</code> or <code>False</code>.</td> |
| 103 | +</tr> |
| 104 | +<tr> |
| 105 | +<td style="text-align: left; color:blue;"><em>Reinitialize</em></td> |
| 106 | +<td style="text-align: left;">Method</td> |
| 107 | +<td style="text-align: left;">Reinitializes the current instance of the class and reserves the storage space desired by the user through the <code>bufferSize</code> parameter.</td> |
| 108 | +</tr> |
| 109 | +<tr> |
| 110 | +<td style="text-align: left; color:blue;"><em>RemoveAt</em></td> |
| 111 | +<td style="text-align: left;">Method</td> |
| 112 | +<td style="text-align: left;">Removes the Item at specified Index.</td> |
| 113 | +</tr> |
| 114 | +<tr> |
| 115 | +<td style="text-align: left; color:blue;"><em>RemoveRange</em></td> |
| 116 | +<td style="text-align: left;">Method</td> |
| 117 | +<td style="text-align: left;">Removes a range of Items starting at the specified Index.</td> |
| 118 | +</tr> |
| 119 | +<tr> |
| 120 | +<td style="text-align: left; color:blue;"><em>Reverse</em></td> |
| 121 | +<td style="text-align: left;">Method</td> |
| 122 | +<td style="text-align: left;">Reverse the order of the internal items, from a given <code>StartIndex</code> to a <code>EndIndex</code>.</td> |
| 123 | +</tr> |
| 124 | +<tr> |
| 125 | +<td style="text-align: left; color:blue;"><em>Reverse2</em></td> |
| 126 | +<td style="text-align: left;">Method</td> |
| 127 | +<td style="text-align: left;">Reverse the order in the target jagged array, from a given <code>StartIndex</code> to a <code>EndIndex</code>.</td> |
| 128 | +</tr> |
| 129 | +<tr> |
| 130 | +<td style="text-align: left; color:blue;"><em>ShrinkBuffer</em></td> |
| 131 | +<td style="text-align: left;">Method</td> |
| 132 | +<td style="text-align: left;">Shrinks the buffer size to avoid extra space reservation.</td> |
| 133 | +</tr> |
| 134 | +<tr> |
| 135 | +<td style="text-align: left; color:blue;"><em>Sort</em></td> |
| 136 | +<td style="text-align: left;">Method</td> |
| 137 | +<td style="text-align: left;">Sorts the internal Items. Requires all Items to be one-dimensional arrays. If the <code>FromIndex</code> is set to <code>-1</code>, the sorting will start at the Items lower bound; when the <code>ToIndex</code> is set to <code>-1</code>, the operation will end at the Items upper bound. The <code>SortingKeys</code> parameter is used to define the index of the columns on which the sorting operation will be performed, negative values indicate sorting in descending order; the user can pass an array of sorting keys as a parameter. The <code>SortAlgorithm</code> parameter indicates which sort algorithm will be used to perform the sort.</td> |
| 138 | +</tr> |
| 139 | +<tr> |
| 140 | +<td style="text-align: left; color:blue;"><em>Swap</em></td> |
| 141 | +<td style="text-align: left;">Method</td> |
| 142 | +<td style="text-align: left;">Swap Items in buffer.</td> |
| 143 | +</tr> |
| 144 | +<tr> |
| 145 | +<td style="text-align: left; color:blue;"><em>Swap2</em></td> |
| 146 | +<td style="text-align: left;">Method</td> |
| 147 | +<td style="text-align: left;">Swap Items in target jagged array.</td> |
| 148 | +</tr> |
| 149 | +<tr> |
| 150 | +<td style="text-align: left; color:blue;"><em>TwoDimToJaggedArray</em></td> |
| 151 | +<td style="text-align: left;">Method</td> |
| 152 | +<td style="text-align: left;">Turns a two-dimensional array into a jagged array. The method will successively deconstruct and delete the two-dimensional, passing its contents to the specified jagged array array.</td> |
| 153 | +</tr> |
| 154 | +</tbody> |
| 155 | +</table> |
| 156 | + |
| 157 | +[Back to API overview](https://ws-garcia.github.io/VBA-CSV-interface/api/) |
0 commit comments