Alx09

java lab5

Oct 27th, 2021
919
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try (Scanner inputFile = new Scanner(fileIn)) {
  2.             Client c = null;
  3.             Banca b = null;
  4.             while (inputFile.hasNext()) {
  5.                  b = new Banca(inputFile.useDelimiter("\\[").next(), null);
  6.                 do {
  7.                  c = new Client(inputFile.useDelimiter(",").skip("\\[\\n").next(), inputFile.useDelimiter("\\[").next(), null);
  8.                  Set<ContBancar> conturi = new HashSet<>();
  9.                  while(inputFile.findInLine("\\],|\\]\\]") != null) {
  10.                      inputFile.useDelimiter(",|\\],|\\]\\]|\\n");
  11.                      conturi.add(new ContBancar(inputFile.next(), Float.parseFloat(inputFile.next()), Moneda.valueOf(inputFile.next()),getCalendar(inputFile.next()), getCalendar(inputFile.next())));
  12.                  }
  13.                  c.adaugaConturiBancare(new Client("", "", conturi));
  14.                
  15.             }while(inputFile.findInLine("\\]\\]\\n") == null);
  16.         }
RAW Paste Data