I have a program which performs a long processing. The first step is converting table from XML format to 2 dimensional array (arr[,]). After that many steps are perfomed and only after them I know if the table has row title or column title. To make it clear, row title means table like:
Name city id
Anna NY 1
Joe NJ 2
column title means:
Name Anna Joe
City NY NJ
id 1 2
The table is processed according to the title. I take to values related to some title and work on them. I'm looking for a way to represent the table in one way so I shouldn't check each time if the table type is rows or columns. I want to avoid something like to following code:
List<Cell> cells;
if (tableType == rows)
cells = table.getCol("Name");
else
cells = table.getRow("Name")
I would be happy to any suggestion.
Thanks!