# IntList in Processing 3

**URL:** <https://discourse.processing.org/t/intlist-in-processing-3/9075>\
**Category:** Coding Questions\
**Created:** [March 7, 2019, 2:24pm UTC](https://discourse.processing.org/t/intlist-in-processing-3/9075 "2019-03-07T14:24:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkxxbdm](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@kkxxbdm](https://discourse.processing.org/u/kkxxbdm)\
**Post date:** [March 7, 2019, 2:24pm UTC](https://discourse.processing.org/t/intlist-in-processing-3/9075/1 "2019-03-07T14:24:38Z")

</div>

I encounter this piece of code.

```auto
int totalSeconds;
Table tripTable; // Table in Processing 3  

ArrayList<Trips> trips = new ArrayList<Trips>(); /// an array which can grow and shrink as needed
ArrayList<String> operators = new ArrayList<String>();
ArrayList<String> vehicle_types = new ArrayList<String>();
ArrayList<Float> bearings = new ArrayList<Float>();

Table vehicleCount;
IntList vehicleCounts;  
int maxVehicleCount;
float hscale = float(totalFrames) / float(width)*0.12;    

Table busCount;
ArrayList<Line> busLines = new ArrayList<Line>();
ArrayList<Integer> busFrames = new ArrayList<Integer>();
ArrayList<Integer> busCounts = new ArrayList<Integer>();
ArrayList<Float> busHeights = new ArrayList<Float>();

Table tramCount;
ArrayList<Line> tramLines = new ArrayList<Line>();
ArrayList<Integer> tramFrames = new ArrayList<Integer>();
ArrayList<Integer> tramCounts = new ArrayList<Integer>();
ArrayList<Float> tramHeights = new ArrayList<Float>();

Table metroCount;
ArrayList<Line> metroLines = new ArrayList<Line>();
ArrayList<Integer> metroFrames = new ArrayList<Integer>();
ArrayList<Integer> metroCounts = new ArrayList<Integer>();
ArrayList<Float> metroHeights = new ArrayList<Float>();

Table cablecarCount;
ArrayList<Line> cablecarLines = new ArrayList<Line>();
ArrayList<Integer> cablecarFrames = new ArrayList<Integer>();
ArrayList<Integer> cablecarCounts = new ArrayList<Integer>();
ArrayList<Float> cablecarHeights = new ArrayList<Float>();

Table trainCount;
ArrayList<Line> trainLines = new ArrayList<Line>();
ArrayList<Integer> trainFrames = new ArrayList<Integer>();
ArrayList<Integer> trainCounts = new ArrayList<Integer>();
ArrayList<Float> trainHeights = new ArrayList<Float>();

Table ferryCount;
ArrayList<Line> ferryLines = new ArrayList<Line>();
ArrayList<Integer> ferryFrames = new ArrayList<Integer>();
ArrayList<Integer> ferryCounts = new ArrayList<Integer>();
ArrayList<Float> ferryHeights = new ArrayList<Float>();

```

A quick/naive questions:  
`IntList vehicleCounts;` What is IntList ? Is it a list that is made of integers? I tried to find this from the internet, but it looks like that I can not find anything about this at all from anywhere, which is really strange.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [March 7, 2019, 2:36pm UTC](https://discourse.processing.org/t/intlist-in-processing-3/9075/2 "2019-03-07T14:36:56Z")

</div>

[https://processing.org/reference/IntList.html](https://processing.org/reference/IntList.html)  
pls. read and understand the different functionality to array.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 9, 2019, 8:40pm UTC](https://discourse.processing.org/t/intlist-in-processing-3/9075/3 "2019-03-09T20:40:18Z")

</div>

This code you found looks like a great example of arriving at a point where it makes sense to move from parallel arrays to objects.

You have vehicle classes, such as bus / tram / ferry / train – and then you have properties of each, which could be modeled through classes rather than trying to align (I assume?) many lists.

[https://processing.org/tutorials/objects/](https://processing.org/tutorials/objects/)
