public Track getTrackByRow(int rowIndex) { this.fillTable(); return table.get(rowIndex); } private void fillTable() { Album currentAlbum = null; int rowNumber = 0; for (int i = 0; i <= this.countAlbums() - 1; i++) { currentAlbum = this.getAlbum(i); for (int j = 0; j <= currentAlbum.size() - 1; j++) { table.put(rowNumber, currentAlbum.getTrack(j)); rowNumber = rowNumber + 1; } } }