Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. public void decrease(int amount) throws NotEnoughMoneyException {
  2.         int walletMoney = this.wallet.getAmountOfMoney();
  3.         if(walletMoney < amount)
  4.             throw new NotEnoughMoneyException();
  5.         else if(walletMoney == amount)
  6.             this.wallet.updateState(new EmptyState(this.wallet));
  7.         else
  8.             this.wallet.safeDecrease(amount);
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement