Olá pessoal,
estou com uma duvida como poderia ler um Collection
e verificar no segundo collection existe dados para gerar um terceiro Collection
Pois vou gerar a terceira Collection da seguinte forma.
ler a collection 1 e se existir na collection 2
deixar na mesma linha na geração collection 3
e se não existir na collection 2 colocar nulo nos campos
Estou em duvida como verificar se a collection 2 tem o mesmo indice
da collection 1 pois se não exister vai ficar coo está na collectin 3 abaixo.
se alguem puder me ajudar
agradeceria
collection 1
i f v
1 3 4
4 5 1
6 7 9
collection 2
i1 f1 v1
5 4 8
Collection 3
i f v i1 f1 v1
1 3 4 5 4 8
4 5 1
6 7 9
else if (cAgenciamentoInicial1.size()!=0 && cAgenciamentoInicial2.size()!=0) {
for (Iterator iter = cAgenciamentoInicial1.iterator();iter.hasNext(); ) {
AgenciamentoTO element = (AgenciamentoTO) iter.next();
agenciamentoNovo = new AgenciamentoTO();
agenciamentoNovo.setNumParcelaInicial(element.getNumParcelaInicial());
agenciamentoNovo.setNumParcelaFinal(element.getNumParcelaFinal());
agenciamentoNovo.setPerAgenciamentoInicial(element.getPerAgenciamentoInicial());
agenciamentoNovo.setNumParcelaInicialMov(new Integer(0));
agenciamentoNovo.setNumParcelaFinalMov(new Integer(0));
agenciamentoNovo.setPerAgenciamentoMov(new Double(0));
cAgenciamentoInicial3.add(agenciamentoNovo);
}
}