Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (Item item : this.tabela.getItem()) {
- // Ingredientes
- final String[] formulainicial = item.getF().getCalculo().clone();
- for (Ingrediente ingrediente : this.tabela.getIngredite()) {
- String tempA[];
- tempA = formulainicial.clone();
- //Subistitue o nome do ingrediente pelo seu valor
- for (int i = 0; i < formulainicial.length; i++) {
- // Procura por nutrientes que contem o mesmo nome e subistitue por valor do nutriente.,
- for (Nutriente n : nuts) {
- if (formulainicial[i].equalsIgnoreCase(n.getNome())) {
- tempA[i] = String.valueOf(n.getQuantidade());
- }
- }
- if ("MO".equalsIgnoreCase(formulainicial[i])) {
- //Esse cara aqui que representa o primeiro valor.
- tempA[i] = String.valueOf(ingrediente.getQuantidadedeMO());
- }
- if ("total".equalsIgnoreCase(formulainicial[i])) {
- tempA[i] = String.valueOf(totaldeMO);
- }
- }
- String exb = "Antes de ser adicionada ao arrayList ";
- for (String ex : tempA) {
- exb += ex;
- }
- System.out.println(exb + '\n');
- novosItems.add(contaItem, item);
- novosItems.get(contaItem).getF().setCalculo(tempA.clone());
- System.out.println(exb + '\n');
- contaItem++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement