Interface ReturnsCalculator

  • All Known Implementing Classes:
    ReturnsCalculators

    public interface ReturnsCalculator
    This interface defines how return is computed from two values of a portfolio.
    • Method Detail

      • computeReturn

        double computeReturn​(double p0,
                             double p1)
        Computes the portfolio return.
        Parameters:
        p0 - the beginning value of the portfolio
        p1 - the ending value of the portfolio
        Returns:
        the return value
      • computePrice

        double computePrice​(double px0,
                            double r)
        Computes the next price after a return.
        Parameters:
        px0 - the original price
        r - the return
        Returns:
        the new price