IntList in Processing 3

I encounter this piece of code.

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.

1 Like

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

1 Like

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/

2 Likes