/** Contructor */ Application() { // inicalizes the lists users = new PersonList("Pessoas.dat", Person.PersonTypes.USER); techs = new PersonList("Pessoas.dat", Person.PersonTypes.WORKER); posts = new StationList("Postos_trab.dat"); tickets = new TicketList("Pedidos.txt", "Intervencoes.txt", users, techs, posts); // loads files posts.loadFile(); users.loadFile(); techs.loadFile(); tickets.loadFile(); }
/** exit's the application */ public void exit() { // saves posts posts.saveFile(); // saves users and techs in one file PersonList pl = new PersonList("Pessoas.dat", Person.PersonTypes.ALL); for (int i = 0; i < users.size(); i++) pl.add(users.get(i)); for (int i = 0; i < techs.size(); i++) pl.add(techs.get(i)); pl.saveFile(); tickets.saveFile(); System.exit(0); }