Class ChargeDecorator

  • All Implemented Interfaces:
    Account

    @Decorator
    public abstract class ChargeDecorator
    extends Object
    implements Account
    Only withdrawal is charged. Implicit implementation that calls the method on the delegate is provided for Account.deposit(int).
    Author:
    Martin Kouba
    • Field Detail

      • charged

        public static int charged
    • Constructor Detail

      • ChargeDecorator

        public ChargeDecorator()
    • Method Detail

      • withdraw

        public void withdraw​(int amount)
        Specified by:
        withdraw in interface Account
      • deposit

        public abstract void deposit​(int amount)
        Specified by:
        deposit in interface Account
      • reset

        public static void reset()