public void execute(BankWindow bankWindow) { if (bankWindow.getCurrentOperation().getTimeOperation() != 0) { bankWindow.getCurrentOperation().doOperation(); } else { switch (bankWindow.getClient().getNumberOperation()) { case Credit.CREDIT: bankWindow.setCountCredits(bankWindow.getCountCredits() + 1); break; case Deposit.DEPOSIT: bankWindow.setCountDeposits(bankWindow.getCountDeposits() + 1); break; case Card.CARD: bankWindow.setCountCards(bankWindow.getCountCards() + 1); break; case Transfer.TRANSFER: bankWindow.setCountTransfers(bankWindow.getCountTransfers() + 1); break; case Payment.PAYMENT: bankWindow.setCountPayments(bankWindow.getCountPayments() + 1); break; } bankWindow.setCountAllOperations(bankWindow.getCountAllOperations() + 1); bankWindow.setClient(null); bankWindow.setCurrentOperation(null); if(bankWindow.isBreak == true) { bankWindow.setState(new BankWindowBreakState()); bankWindow.isBreak = false; } else bankWindow.setState(new BankWindowFreeState()); } }