WebCab Bonds Demo
(J2EE Edition)

com.webcab.ejb.finance.interest
Interface Interest

All Superinterfaces:
EJBObject, Remote

public interface Interest
extends EJBObject

This Enterprise JavaBean performs calculations related to investments which pay a simple or compound interest.


Method Summary
 double accumulatedValue(double initialDeposit, int noOfPeriods, double interest)
          Calculates the accumulated value of a fixed interest bearing investment.
 double averageInflation(double[] inflation)
          Evaluates the average rate of inflation during a period in which the rate of inflation is known at equal intervals within the entire period.
 double averageInterest(double[] interest)
          Evaluates the average rate of interest during a period when the rate of interest is measured at equal intervals within the entire period.
 double continuouslyCompounded(double initialInvestment, double forceOfInterest, double investmentPeriod)
          Calculates the accumulated amount from an investment which is continuously compounded over a given period.
 double depositAfterOnePeriod(double initialDeposit, double interest)
          Calculates the accumulated value of an interest bearing investment after the initial interest payment.
 double depreciation(double[] depreciation, double initialValue)
          Evaluates the value (or book value) of an asset after a number of time periods which may have differing rates of depreciation.
 double depreciation(double depreciation, double initialValue, int periods)
          Calculates an assets value (or book value) at the end of a number of time periods when an assets constant rate of depreciation is known.
 double depreciationRate(double initialValue, double finalValue, int periods)
          Calculates the average depreciation rate of an asset after a given number of time periods of equal duration.
 double initialDeposit(double finalAmount, double interest, double periods)
          Returns the amount which initially needs to be deposited within an interest bearing investment in order to attain a pre-determined amount at a future date.
 double initialInvestment(double finalAmount, double investmentPeriod, double forceOfInterest)
          Evaluates the amount which needs to be initially invested within a continuously compounded investment in order to achieve a certain level of return.
 double initialWorth(double finalAmount, double inflation, double dayCountConvention, double periods, double noOfDays, double interest)
          Evaluates the amount needed to be initially invested in order for the real worth of a fixed interest bearing investment to have a pre-determined real worth at expiry.
 double realReturn(double interest, double inflation)
          Calculates the real return of an interest bearing investment over a given period when the average rate of inflation and the average rate of interest over that period are known.
 double realReturnEurope(double interest, double inflation, int periods, int noOfDays)
          Evaluates the real return from an interest bearing investment over equal time periods when the annual rate of inflation is quoted according to the European day count convention of 360 days per annum.
 double realReturnGeneral(double interest, double inflation, int dayCountConvention, double periods, double noOfDays)
          Calculate the real return of a fixed interest bearing investment over equal time periods when the fixed `annual' rate of inflation is known.
 double realReturnUkJapan(double interest, double inflation, int periods, int noOfDays)
          Evaluates the real return from an interest bearing investment over equal time periods when the annual rate of inflation is quoted according to the UK and Japanese day count convention of 365 days per annum.
 double realWorth(double initialDeposit, double interest, double inflation)
          Calculates the real worth of an interest bearing investment over a given period when the average rate of inflation and the average interest rate over the investment period are known.
 double realWorthEurope(double initialInvestment, double interest, int noOfPeriods, double inflation, double noOfDays)
          Calculate the real worth of a fixed rate interest bearing investment over `noOfPeriods' periods of time according to the European convention for quoting the annual inflation over 360 days.
 double realWorthGeneral(double initialInvestment, double interest, int noOfPeriods, int dayCountConvention, double inflation, double noOfDays)
          Calculate the real worth of a fixed rate interest bearing investment over equal time periods when the annual rate of inflation is quoted with respect to some integer number of days.
 double realWorthUkJapan(double initialInvestment, double interest, int noOfPeriods, double inflation, double noOfDays)
          Calculate the real worth of a fixed rate interest bearing investment according to the UK and Japanese convention for quoting the annual inflation over 365 days.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

depositAfterOnePeriod

public double depositAfterOnePeriod(double initialDeposit,
                                    double interest)
                             throws InterestDemoException,
                                    RemoteException
Calculates the accumulated value of an interest bearing investment after the initial interest payment.

Parameters:
initialDeposit - the amount which is initially invested within the interest bearing investment
interest - the fixed interest rate which the investment pays expressed in decimal format (i.e. 0.01 = 1 percent).
InterestDemoException
RemoteException

realWorth

public double realWorth(double initialDeposit,
                        double interest,
                        double inflation)
                 throws InterestDemoException,
                        RemoteException
Calculates the real worth of an interest bearing investment over a given period when the average rate of inflation and the average interest rate over the investment period are known. The real worth is the inflation adjusted value of an investment over a given period.

Parameters:
initialDeposit - the amount which is initially invested within the interest bearing investment
interest - the average rate of interest paid by the investment during the investment period expressed in decimal format (i.e. 1 percent = 0.01)
inflation - the average rate of inflation over the investment period expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

realReturn

public double realReturn(double interest,
                         double inflation)
                  throws InterestDemoException,
                         RemoteException
Calculates the real return of an interest bearing investment over a given period when the average rate of inflation and the average rate of interest over that period are known. The real return is the inflation adjusted return from the investment.

Parameters:
interest - the average rate of interest paid of the interest bearing investment over the period expressed in decimal format (i.e. 1 percent = 0.01)
inflation - the average rate of inflation during the period under consideration expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

averageInflation

public double averageInflation(double[] inflation)
                        throws InterestDemoException,
                               RemoteException
Evaluates the average rate of inflation during a period in which the rate of inflation is known at equal intervals within the entire period. For example, if the annual rate of inflation over the last three years has been 2%, 3%, 4%, respectively, then the average annual rate of inflation over the three year period would be 3%.

Parameters:
inflation - an array of measurements of the inflation rates during the considered periods where each inflation rate is expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

averageInterest

public double averageInterest(double[] interest)
                       throws InterestDemoException,
                              RemoteException
Evaluates the average rate of interest during a period when the rate of interest is measured at equal intervals within the entire period. For example, if the annual rate of interest over the last three years has been 2%, 3%, 4%, respectively, then the average annual rate of inflation over the three year period would be 3%.

Parameters:
interest - an array of measurements of the known interest rates during the considered periods where each interest rate is expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

accumulatedValue

public double accumulatedValue(double initialDeposit,
                               int noOfPeriods,
                               double interest)
                        throws InterestDemoException,
                               RemoteException
Calculates the accumulated value of a fixed interest bearing investment. That is, we evaluate the value of an investment resulting from the compounding on that investment of a fixed interest over a number of compounding periods.

Parameters:
initialDeposit - the amount which is initially invested within the fixed interest bearing investment.
noOfPeriods - the number of periods over which the interest must is compounded
interest - the fixed rate of interest of the investment over the entire period expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

initialDeposit

public double initialDeposit(double finalAmount,
                             double interest,
                             double periods)
                      throws InterestDemoException,
                             RemoteException
Returns the amount which initially needs to be deposited within an interest bearing investment in order to attain a pre-determined amount at a future date.

Parameters:
finalAmount - the amount which the investment is worth at the end in of time period
interest - the fixed interest rate which is paid by the investment over each period expressed in decimal format (i.e. 1 percent = 0.01)
periods - the number of time periods which the investment runs over
InterestDemoException
RemoteException

realWorthEurope

public double realWorthEurope(double initialInvestment,
                              double interest,
                              int noOfPeriods,
                              double inflation,
                              double noOfDays)
                       throws InterestDemoException,
                              RemoteException
Calculate the real worth of a fixed rate interest bearing investment over `noOfPeriods' periods of time according to the European convention for quoting the annual inflation over 360 days.

Parameters:
initialInvestment - the initial investment within the fixed interest bearing investment
noOfPeriods - the number of equal time periods over which the investment is compounded
noOfDays - the length in days of each time period over which the investment is compounded
interest - the fixed rate of interest per period which is paid by the investment expressed in decimal format (i.e. 1 percent = 0.01)
inflation - fixed annual rate of inflation according to the European convention expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

realWorthUkJapan

public double realWorthUkJapan(double initialInvestment,
                               double interest,
                               int noOfPeriods,
                               double inflation,
                               double noOfDays)
                        throws InterestDemoException,
                               RemoteException
Calculate the real worth of a fixed rate interest bearing investment according to the UK and Japanese convention for quoting the annual inflation over 365 days.

Parameters:
initialInvestment - the initial investment within the fixed interest bearing investment
noOfPeriods - the number of equal time periods over which the investment is compounded
noOfDays - the length in days of each time period over which the interest is compounded
interest - the fixed rate of interest per period which is paid by the investment expressed in decimal format (i.e. 1 percent = 0.01)
inflation - fixed annual rate in inflation according to the UK and Japanese convention expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

realWorthGeneral

public double realWorthGeneral(double initialInvestment,
                               double interest,
                               int noOfPeriods,
                               int dayCountConvention,
                               double inflation,
                               double noOfDays)
                        throws InterestDemoException,
                               RemoteException
Calculate the real worth of a fixed rate interest bearing investment over equal time periods when the annual rate of inflation is quoted with respect to some integer number of days.

Parameters:
initialInvestment - the initial investment
noOfPeriods - the number of equal time periods over which the interest is compounded
noOfDays - the length in days of each time period over which the interest is compounded
interest - the fixed rate of interest per period which is paid by the investment expressed in decimal format (i.e. 1 percent = 0.01)
inflation - fixed annual rate in inflation according to the UK and Japanese convention expressed in decimal format (i.e. 1 percent = 0.01)
dayCountConvention - the number of days over which the annual rate of inflation in quoted
InterestDemoException
RemoteException

initialWorth

public double initialWorth(double finalAmount,
                           double inflation,
                           double dayCountConvention,
                           double periods,
                           double noOfDays,
                           double interest)
                    throws InterestDemoException,
                           RemoteException
Evaluates the amount needed to be initially invested in order for the real worth of a fixed interest bearing investment to have a pre-determined real worth at expiry. That is, we determine the amound which means to be invested in order to acheive a given purchasing powers at a future date from a fixed interest investment.

Parameters:
finalAmount - the amount which the investor requires at the end of the time period
inflation - fixed `annual' rate of inflation quoted with respect to the day count convention expressed in decimal format (i.e. 1 percent = 0.01)
dayCountConvention - the number of days over which the inflation is quoted. In the case that the European 360 day convention is used then this parameter will take the value 360, in the case that the UK/Japan convention is used then this parameter will be 365
periods - number of interest compounding time periods over which the investment in held
noOfDays - the length in days of each period over which the interest is compounded.
interest - the fixed interest rate paid by the interest bearing investment over each period expressed in decimal format (i.e. 1 percent = 0.01)
InterestDemoException
RemoteException

realReturnUkJapan

public double realReturnUkJapan(double interest,
                                double inflation,
                                int periods,
                                int noOfDays)
                         throws InterestDemoException,
                                RemoteException
Evaluates the real return from an interest bearing investment over equal time periods when the annual rate of inflation is quoted according to the UK and Japanese day count convention of 365 days per annum. The real return measures the inflation adjusted return from an interest bearing investment.

Parameters:
inflation - the annual rate of inflation according to the UK and Japanese day count convention expressed in decimal format (i.e. 1 percent = 0.01)
interest - fixed interest rate during the period when the investment is held expressed in decimal format (i.e. 1 percent = 0.01)
periods - the number of time periods over which the real return is calculated
noOfDays - the number of days in each period over which the interest is compounded
InterestDemoException
RemoteException

realReturnEurope

public double realReturnEurope(double interest,
                               double inflation,
                               int periods,
                               int noOfDays)
                        throws InterestDemoException,
                               RemoteException
Evaluates the real return from an interest bearing investment over equal time periods when the annual rate of inflation is quoted according to the European day count convention of 360 days per annum. The real return measures the inflation adjusted return from an interest bearing investment.

Parameters:
inflation - the annual rate of inflation according to the European day count convention expressed in decimal format (i.e. 1 percent = 0.01)
interest - fixed interest rate during the period when the investment is held expressed in decimal format (i.e. 1 percent = 0.01)
periods - the number of time periods over which the real return is calculated
noOfDays - the length in days of each time period over which the interest is compounded
InterestDemoException
RemoteException

realReturnGeneral

public double realReturnGeneral(double interest,
                                double inflation,
                                int dayCountConvention,
                                double periods,
                                double noOfDays)
                         throws InterestDemoException,
                                RemoteException
Calculate the real return of a fixed interest bearing investment over equal time periods when the fixed `annual' rate of inflation is known. The real return measures the inflation adjusted return from an interest bearing investment.

Parameters:
inflation - the rate of inflation which is quoted with respect to the particular day count convention expressed in decimal format (i.e. 1 percent = 0.01)
dayCountConvention - the number of days over which the annual rate of inflation is quoted
interest - the fixed interest rate which is paid by the investment during the period under consideration expressed in decimal format (i.e. 1 percent = 0.01)
periods - the number of time periods over which the real return is calculated
noOfDays - the length in days of each time period over which the interest is compounded
InterestDemoException
RemoteException

depreciation

public double depreciation(double depreciation,
                           double initialValue,
                           int periods)
                    throws InterestDemoException,
                           RemoteException
Calculates an assets value (or book value) at the end of a number of time periods when an assets constant rate of depreciation is known.

Parameters:
initialValue - the initial value of the asset
depreciation - the constant rate of depreciation of the asset in decimal format (i.e. 1 percent = 0.01)
periods - the number of equal time periods over which the asset depreciates.
InterestDemoException
RemoteException

depreciation

public double depreciation(double[] depreciation,
                           double initialValue)
                    throws InterestDemoException,
                           RemoteException
Evaluates the value (or book value) of an asset after a number of time periods which may have differing rates of depreciation.

Parameters:
initialValue - the initial value of the asset
depreciation - is an array of doubles which gives the percentage depreciation rate for each period over which the asset depreciates. The percentage for each period is expressed in decimal format (i.e. 1 percent = 0.01).
InterestDemoException
RemoteException

depreciationRate

public double depreciationRate(double initialValue,
                               double finalValue,
                               int periods)
                        throws InterestDemoException,
                               RemoteException
Calculates the average depreciation rate of an asset after a given number of time periods of equal duration.

Parameters:
initialValue - the initial value of the asset
finalValue - the value (or book value) of the asset at the end of the periods
periods - the number of equal time periods over which the asset depreciates.
InterestDemoException
RemoteException

continuouslyCompounded

public double continuouslyCompounded(double initialInvestment,
                                     double forceOfInterest,
                                     double investmentPeriod)
                              throws InterestDemoException,
                                     RemoteException
Calculates the accumulated amount from an investment which is continuously compounded over a given period.

Parameters:
initialInvestment - the amount which is initially invested and continuously compounded
forceOfInterest - the force of interest with respect to some time units (days or years etc) expressed in decimal format (i.e. 1 percent = 0.01)
investmentPeriod - the time period over which the investment is held. Note that the units used to measure time must be the same as the units used for the forceOfInterest
InterestDemoException
RemoteException

initialInvestment

public double initialInvestment(double finalAmount,
                                double investmentPeriod,
                                double forceOfInterest)
                         throws InterestDemoException,
                                RemoteException
Evaluates the amount which needs to be initially invested within a continuously compounded investment in order to achieve a certain level of return.

Parameters:
finalAmount - the amount which the investor requires at the end of the investment period
forceOfInterest - the force of interest with respect to some time units (days or years etc) expressed in decimal format.
investmentPeriod - the time period over which the investment is held. Note that the units used to measure time must be the same as the units used for the forceOfInterest
InterestDemoException
RemoteException

WebCab Bonds Demo
(J2EE Edition)