Ler linhas do gráfico Excel

Como posso ler as linhas(horizontalmente) do gráfico Excel?
Desta forma abaixo ele lê por colunas(verticalmente)

Iterator<Row> rowIterator = sheet2.iterator(); //sheet2 é uma planilha
            ArrayList<String> addreesVectorSeries = new ArrayList<>();
            ArrayList<String> addreesVectorCategory = new ArrayList<>();

            while (rowIterator.hasNext()) { //varre as linhas
                Row row2 = rowIterator.next();
                Iterator<Cell> cellIterator = row2.cellIterator();
                while (cellIterator.hasNext()) { //varre as celulas
                    Cell cell2 = cellIterator.next();
                    switch (cell2.getCellType()) { //verifica o tipo
                        case Cell.CELL_TYPE_NUMERIC:
                            break;
                        case Cell.CELL_TYPE_STRING:
                            if (cell2.getAddress().formatAsString().startsWith("A")) {
                                //System.out.println("str " + cell2.getAddress());
                                addreesVectorCategory.add(cell2.getAddress().formatAsString());
                            }
                            if (cell2.getAddress().formatAsString().startsWith("B")) {
                                larguraGrafico++;
                                addreesVectorSeries.add(cell2.getAddress().formatAsString());
                            }
                            break;
                        case Cell.CELL_TYPE_FORMULA:
                            //System.out.println("form " + cell2.getAddress());
                            if (cell2.getAddress().formatAsString().startsWith("B")) {
                                larguraGrafico++;
                                addreesVectorSeries.add(cell2.getAddress().formatAsString());
                            }
                            break;
                    }
                }
            }

Não mesmo.
Você lê por células.
Veja que você tem isso:

Iterator<Row> rowIterator = sheet2.iterator();

Que pega um iterator de linhas, certo?

Depois, tem isso

while (rowIterator.hasNext()) { //varre as linhas
    Row row2 = rowIterator.next();

Que significa que está lendo linha a linha. Não?
Aí, para ler o conteúdo específico de cada célula, você, sim, informa qual a coluna que deseja ler, a partir da posição 0, Afinal, lembrando do plano cartesiano e a combinação de eixos, você tem um par que identifica a célula (linha, coluna).:

1 curtida

image exemplo

O que o código acima faz é ler h1,h2,h3 depois i1,i2,i3 assim por diante.O que eu gostaria de fazer é ler h1,i1,j1 depois h2,i2,j2 depois h3,i3,j3.Como posso fazer isso?

Segundo o que consta neste trecho de código que você postou, o comportamento devera ser diferente

while (rowIterator.hasNext()) { //Anda linha a linha 0, 1, 2, 3, 4...
    Row row2 = rowIterator.next();
    Iterator<Cell> cellIterator = row2.cellIterator();
    while (cellIterator.hasNext()) { //anda célula a célua 0, 1, 2, 3, 4
    Cell cell2 = cellIterator.next();

Ou seja, teoricamente, este trecho de código leria H1, I1, J1/ H2, I2, J2, Hx, Ix, Jx