This document describes how to implement ArrayList in a block coding manner.
Index
Definition of ArrayList
•
ArrayList is a data structure that uses continuous memory space to have data.
ArrayList Block
•
Introduces the blocks entered the ArrayList category of SyncTree NBlock.
1) ArrayList
•
Used to create (declare) an ArrayList data structure.
•
Click the button to add or remove Value items.
•
Below is an example of the ArrayList block declaration.
2) Get Array Variable
•
Use to import the Value of ArrayList as a whole, or a specific Key.
•
Enter the variable name of the ArrayList object to import the information as the first factor.
•
From the second factor (Item Keys), enter the index of ArrayList to import Value within ArrayList as Integer.
•
If no Value is entered in Item Keys, Value is added after the last index in the ArrayList.
•
Click the button to add or remove Value items.
•
If Item Keys is added, the index is sequentially searched in the nested ArrayList to find the value.
•
Below is an example of using Get ArrayList Block.
3) Add Array Variable
•
Adds a Value to ArrayList.
•
Enter the variable name of the ArrayList object to which you want to add information as the first factor.
•
Enter the Value to add to the Add value.
•
Click the button to add or remove Item Keys.
•
If Item Keys is added, values are added by sequentially searching indexes in the nested ArrayList.
•
Below is an example of using Add Array Block.
4) Remove Array Variable
•
Remove Key and Value from ArrayList.
•
Enter the variable name of the ArrayList object to import the information as the first factor.
•
Click the button to add or remove Item Keys.
•
From the second factor (Item Keys), enter the index of the Value to remove within the ArrayList.
•
If Item Keys is added, the index is sequentially searched in the nested ArrayList and values are removed.
•
Below is an example of using Remove Array Block.