I will explain on the example of cars. I have a table in CSV with a large number of columns and rows. First columns (for sorting filter) - Type (passenger, jeep, cargo), Manufacturer (VAZ, Porsche, Ford), then columns with parameters - Volume, Drive, Color, etc. The program will need a filter mode and selection mode. Suppose there are 90 lines in them 30 positions of each Type, each Type of 10 positions of each manufacturer.
Filter mode: from the table all unique Types are taken and transferred to Spinner. After selecting in the drop-down list, for example, a passenger car, in the second Spinner, all Manufacturers are started whose Type column is passenger.
Selection mode: all unique Types are taken from the table and transferred to Spinner. Type is selected and some parameters from other columns are set. After that, the selection from the table according to the specified criteria occurs. I once solved a similar task, but it was a collective-farm-handicraft way. Now I want a more correct approach.
As I see the solution: create a class Cars with fields for all columns. When you open the activit, the table will be read-parsed and a collection of all rows of the table will be created in the Cars object. In the class, create some functions that return filtered collection pieces, unique lists, etc. Well, the result is packaged in the list. Tell me what methods and what is better to use? It's easy to take arrays, hash, map, how to filter / select faster, etc.