Escolar Documentos
Profissional Documentos
Cultura Documentos
getSheet(FOLHA_ALUNO); List<Aluno> alunos = new ArrayList<Aluno>(folhaAlunos.getRows()); List<Curso> cursos = new ArrayList<Curso>(); for(int i=0; i< folhaAlunos.getRows(); i++){ NumberCell nc1 = (NumberCell) folhaAlunos.getCell(NUMEROAL_COL, i); int numeroa = (int)nc1.getValue(); LabelCell lc = (LabelCell) folhaAlunos.getCell(NOMEAL_COL, i); String nome = lc.getString(); DateCell dc = (DateCell) folhaAlunos.getCell(NASCIMENTOAL_COL, i ); Date nascimento = dc.getDate(); Aluno a = new Aluno(nome, numeroa, nascimento); NumberCell nc = (NumberCell)folhaAlunos.getCell(CURSOAL_COL, i); Curso c = getCurso(cursos, (int)nc.getValue()); a.setCurso(c); alunos.add(a); return alunos; } } catch (IOException ex) { Logger.getLogger(ExcelDB.class.getName()).log(Level.SEVERE, null, ex ); } catch (BiffException ex) { Logger.getLogger(ExcelDB.class.getName()).log(Level.SEVERE, null, ex ); } return null; } private Curso getCurso(List<Curso> cursos, int id){ for(Curso c : cursos){ if(c.getId()==id){ return c; } } return null; }