JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.finance
Class InterestCalculator

java.lang.Object
  extended by net.sf.japi.finance.InterestCalculator

public class InterestCalculator
extends Object

Class contains some functionality for calculating capital after some periods of time.

Author:
A. Heim

Constructor Summary
InterestCalculator(float initialCapital, float interestRate)
           
 
Method Summary
 float calculateCapital(int numberOfPeriods)
          Calculates the overall capital after some periods beginnig with given initial capital and interest rate.
 float getCurrentCapital()
          Returns the current capital.
 float getInterestRate()
          Returns the current interest rate.
 void resetCapital()
          Resets the current capital to initial capital.
 void setCurrentCapital(float currentCapital)
          Sets new current capital.
 void setInterestRate(float interestRate)
          Sets new interest rate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterestCalculator

public InterestCalculator(float initialCapital,
                          float interestRate)
Method Detail

calculateCapital

public float calculateCapital(int numberOfPeriods)
Calculates the overall capital after some periods beginnig with given initial capital and interest rate.
The formula is: capital_after_n_periods = start_captial * ( 1 + p/100 )^n (with p as interest rate)

Parameters:
numberOfPeriods -
Returns:
the overall capital after numberOfPeriods periods

getCurrentCapital

public float getCurrentCapital()
Returns the current capital.

Returns:
current capital

setCurrentCapital

public void setCurrentCapital(float currentCapital)
Sets new current capital.

Parameters:
currentCapital -

setInterestRate

public void setInterestRate(float interestRate)
Sets new interest rate.

Parameters:
interestRate -

getInterestRate

public float getInterestRate()
Returns the current interest rate.

Returns:
the current interest rate

resetCapital

public void resetCapital()
Resets the current capital to initial capital.


JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright