# Data structure: table vs. \<class\>ArrayList

**URL:** <https://discourse.processing.org/t/data-structure-table-vs-class-arraylist/42239>\
**Category:** Beginners\
**Created:** [June 17, 2023, 3:48pm UTC](https://discourse.processing.org/t/data-structure-table-vs-class-arraylist/42239 "2023-06-17T15:48:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 17, 2023, 3:48pm UTC](https://discourse.processing.org/t/data-structure-table-vs-class-arraylist/42239/1 "2023-06-17T15:48:48Z")

</div>

Hello all,

I am working on a vocabulary test Sketch and I load a csv file with word pairs.

I work with the table then when presenting the words in the test.

But the table feels clumsy here.

Would it be easier to parse the table to a class WordPair and then use an ArrayList of it?

Thank you!

Warm regards,

Chrisir

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 17, 2023, 7:33pm UTC](https://discourse.processing.org/t/data-structure-table-vs-class-arraylist/42239/2 "2023-06-17T19:33:54Z")

</div>

> [@Chrisir](#):
>
> Would it be easier to parse the Table to a class WordPair and then an ArrayList of it?

> [@The operator \> is undefined for the argument - HOW TO RESOLVE ERROR (OOP)](https://discourse.processing.org/t/the-operator-is-undefined-for-the-argument-how-to-resolve-error-oop/38705/6):
>
> If you wish you can take a look at a very old deck of cards implementation I did a long time ago: [Picking cards at random, then excluding those from further picking. - Processing 2.x and 3.x Forum](https://forum.Processing.org/two/discussion/2801/picking-cards-at-random-then-excluding-those-from-further-picking-#Item_2) It’s split into 2 sketches: 1 creates & saves the “.csv” file, while the other loads it and makes a deck of cards out of it. For convenience I’ve merged them now into 1 sketch w/ 4 “.pde” tabs: “Table\_CSV\_Card\_Pack.pde”: /\*\* \* Table CSV Card Pack (v1.0.1) \* by GoToLoop (2022/Sep/13) \* \* htt…

Sketch above “Table CSV Card Pack” loads file “Cardpack.csv”, creates a Card[] array and transfers Table columns “Number”, “Rank”, “Suit”, “Image” to Card fields _value_, _rank_, _suit_, _img_ respectively.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [June 18, 2023, 9:26am UTC](https://discourse.processing.org/t/data-structure-table-vs-class-arraylist/42239/3 "2023-06-18T09:26:12Z")

</div>

Thanks!

Yeah, I guess it’s easier to use an array/class structure instead of using a table.
