Class SimpleBudget

  • All Implemented Interfaces:
    Budget

    public class SimpleBudget
    extends Object
    implements Budget
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleBudget​(int time)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doubleAddition()
      Inform the Budget class that a double addition has been performed by the tree.
      void doubleAddition​(int number)
      Inform the Budget that a certain number of double additions have been performed.
      void doubleDivision()
      Inform the Budget class that a double division has been performed by the tree.
      void doubleDivision​(int number)
      Inform the Budget that a certain number of double divisions have been performed.
      void doubleMultiplication()
      Inform the Budget class that a double multiplicaton has been performed by the tree.
      void doubleMultiplication​(int number)
      Inform the Budget that a certain number of double multiplications have been performed.
      boolean hasMoreTime()
      A function for the tree to ask if there is budget(time) left.
      void integerAddition()
      Inform the Budget class that an integer addition has been performed by the tree.
      void integerAddition​(int number)
      Inform the Budget that a certain number of integer additions have been done.
      void integerDivision()
      Inform the Budget class that a integer division has been performed by the tree.
      void integerDivision​(int number)
      Inform the Budget that a certain number of integer divisions have been performed.
      void integerMultiplication()
      Inform the Budget class that a integer multiplicaton has been performed by the tree.
      void integerMultiplication​(int number)
      Inform the Budget that a certain number of integer multiplications have been performed.
    • Constructor Detail

      • SimpleBudget

        public SimpleBudget​(int time)
    • Method Detail

      • hasMoreTime

        public boolean hasMoreTime()
        Description copied from interface: Budget
        A function for the tree to ask if there is budget(time) left.
        Specified by:
        hasMoreTime in interface Budget
        Returns:
        A boolean that is true if the tree should go on, false otherwise.
      • integerAddition

        public void integerAddition()
        Description copied from interface: Budget
        Inform the Budget class that an integer addition has been performed by the tree.
        Specified by:
        integerAddition in interface Budget
      • integerAddition

        public void integerAddition​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of integer additions have been done.
        Specified by:
        integerAddition in interface Budget
        Parameters:
        number - the number of additions done.
      • doubleAddition

        public void doubleAddition()
        Description copied from interface: Budget
        Inform the Budget class that a double addition has been performed by the tree.
        Specified by:
        doubleAddition in interface Budget
      • doubleAddition

        public void doubleAddition​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of double additions have been performed.
        Specified by:
        doubleAddition in interface Budget
        Parameters:
        number - the number of additions done.
      • integerMultiplication

        public void integerMultiplication()
        Description copied from interface: Budget
        Inform the Budget class that a integer multiplicaton has been performed by the tree.
        Specified by:
        integerMultiplication in interface Budget
      • integerMultiplication

        public void integerMultiplication​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of integer multiplications have been performed.
        Specified by:
        integerMultiplication in interface Budget
        Parameters:
        number - the number of multiplication done.
      • doubleMultiplication

        public void doubleMultiplication()
        Description copied from interface: Budget
        Inform the Budget class that a double multiplicaton has been performed by the tree.
        Specified by:
        doubleMultiplication in interface Budget
      • doubleMultiplication

        public void doubleMultiplication​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of double multiplications have been performed.
        Specified by:
        doubleMultiplication in interface Budget
        Parameters:
        number - the number of multiplications done.
      • integerDivision

        public void integerDivision()
        Description copied from interface: Budget
        Inform the Budget class that a integer division has been performed by the tree.
        Specified by:
        integerDivision in interface Budget
      • integerDivision

        public void integerDivision​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of integer divisions have been performed.
        Specified by:
        integerDivision in interface Budget
        Parameters:
        number - the number of division done.
      • doubleDivision

        public void doubleDivision()
        Description copied from interface: Budget
        Inform the Budget class that a double division has been performed by the tree.
        Specified by:
        doubleDivision in interface Budget
      • doubleDivision

        public void doubleDivision​(int number)
        Description copied from interface: Budget
        Inform the Budget that a certain number of double divisions have been performed.
        Specified by:
        doubleDivision in interface Budget
        Parameters:
        number - the number of divisions done.