Interface Budget

  • All Known Implementing Classes:
    SimpleBudget

    public interface Budget
    This is an interface for classes that are to be given along with every data point inserted in the tree. The tree has to inform the implementation of this Budget interface of every operation it does, and ask at the places where it can stop prematurely if it should. This models the arrival of a new data point in the stream, before there was enough time to insert the current one.
    • Method Summary

      All Methods Instance Methods Abstract 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.
    • Method Detail

      • hasMoreTime

        boolean hasMoreTime()
        A function for the tree to ask if there is budget(time) left.
        Returns:
        A boolean that is true if the tree should go on, false otherwise.
      • integerAddition

        void integerAddition()
        Inform the Budget class that an integer addition has been performed by the tree.
      • integerAddition

        void integerAddition​(int number)
        Inform the Budget that a certain number of integer additions have been done.
        Parameters:
        number - the number of additions done.
      • doubleAddition

        void doubleAddition()
        Inform the Budget class that a double addition has been performed by the tree.
      • doubleAddition

        void doubleAddition​(int number)
        Inform the Budget that a certain number of double additions have been performed.
        Parameters:
        number - the number of additions done.
      • integerMultiplication

        void integerMultiplication()
        Inform the Budget class that a integer multiplicaton has been performed by the tree.
      • integerMultiplication

        void integerMultiplication​(int number)
        Inform the Budget that a certain number of integer multiplications have been performed.
        Parameters:
        number - the number of multiplication done.
      • doubleMultiplication

        void doubleMultiplication()
        Inform the Budget class that a double multiplicaton has been performed by the tree.
      • doubleMultiplication

        void doubleMultiplication​(int number)
        Inform the Budget that a certain number of double multiplications have been performed.
        Parameters:
        number - the number of multiplications done.
      • integerDivision

        void integerDivision()
        Inform the Budget class that a integer division has been performed by the tree.
      • integerDivision

        void integerDivision​(int number)
        Inform the Budget that a certain number of integer divisions have been performed.
        Parameters:
        number - the number of division done.
      • doubleDivision

        void doubleDivision()
        Inform the Budget class that a double division has been performed by the tree.
      • doubleDivision

        void doubleDivision​(int number)
        Inform the Budget that a certain number of double divisions have been performed.
        Parameters:
        number - the number of divisions done.