java.lang.Object | +--com.cedarspring.tvm.InterestRate
Annual Nominal Interest Rate
Interest is a charge for borrowing money, usually stated as a
percentage of the amount borrowed over a specific period of time.
Compound interest is calculated each period on the original
amount borrowed plus all unpaid interest accumulated to date. Compound
interest is always assumed in TVM problems.
This class will:
| Nested Class Summary | |
(package private) class |
InterestRate.SolveI
|
(package private) class |
InterestRate.SolveIE
|
| Field Summary | |
private int |
compoundingPerYear
|
private boolean |
enterRateAsPercent
|
private FindRoot |
findRoot
|
private IFTables |
ift
|
private int |
paymentsPerYear
|
private java.math.BigDecimal |
rateEstimate
|
(package private) static long |
serialVersionUID
|
private static java.math.BigDecimal |
UPPER_LIMIT
|
private java.math.BigDecimal |
value
|
| Constructor Summary | |
(package private) |
InterestRate()
Construct a default InterestRate Object. |
| Method Summary | |
(package private) void |
computeValue(java.math.BigDecimal n,
java.math.BigDecimal pmt,
java.math.BigDecimal fv,
java.math.BigDecimal pv,
boolean end,
Options o)
Compute annual nominal interest rate. |
(package private) int |
getCompoundingPerYear()
Recall compounding periods per year |
(package private) java.math.BigDecimal |
getEffectiveRate(Options o)
Recall annual effective interest rate. |
(package private) boolean |
getEnterRateAsPercent()
Recall interest rate representation (decimal or percent) |
(package private) java.math.BigDecimal |
getIE(java.math.BigDecimal nominal,
int period,
Options o)
|
(package private) java.math.BigDecimal |
getIP(Options o)
|
(package private) int |
getPaymentsPerYear()
Recall payments per year. |
(package private) java.math.BigDecimal |
getRateEstimate()
Recall interest rate estimate |
(package private) java.math.BigDecimal |
getValue()
Recall annual nominal interest rate. |
(package private) void |
setCompoundingPerYear(int newCompoundingPerYear)
Store compounding periods per year. |
(package private) void |
setEnterRateAsPercent(boolean newEnterRateAsPercent)
Store interest rate representation (decimal or percent) |
(package private) void |
setPaymentsPerYear(int newPaymentsPerYear)
Store payments per year. |
(package private) void |
setRateEstimate(java.math.BigDecimal newRateEstimate)
Store interest rate estimate. |
(package private) void |
setValue(java.math.BigDecimal newValue,
Options o)
Store annual nominal interest rate. |
java.lang.String |
toString()
Return interestRate as a string |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.math.BigDecimal value
private boolean enterRateAsPercent
private java.math.BigDecimal rateEstimate
private int compoundingPerYear
private int paymentsPerYear
private IFTables ift
private FindRoot findRoot
private static final java.math.BigDecimal UPPER_LIMIT
static final long serialVersionUID
| Constructor Detail |
InterestRate()
| Method Detail |
void setValue(java.math.BigDecimal newValue,
Options o)
throws TVMException
TVMExceptionsetEnterRateAsPercent(boolean),
setCompoundingPerYear(int),
setPaymentsPerYear(int)java.math.BigDecimal getValue()
setEnterRateAsPercent(boolean)
void computeValue(java.math.BigDecimal n,
java.math.BigDecimal pmt,
java.math.BigDecimal fv,
java.math.BigDecimal pv,
boolean end,
Options o)
throws TVMException
TVMException
void setCompoundingPerYear(int newCompoundingPerYear)
throws TVMException
TVMExceptionsetPaymentsPerYear(int)int getCompoundingPerYear()
void setPaymentsPerYear(int newPaymentsPerYear)
throws TVMException
TVMExceptionsetCompoundingPerYear(int)int getPaymentsPerYear()
void setEnterRateAsPercent(boolean newEnterRateAsPercent)
boolean getEnterRateAsPercent()
void setRateEstimate(java.math.BigDecimal newRateEstimate)
java.math.BigDecimal getRateEstimate()
public java.lang.String toString()
toString in class java.lang.Object
java.math.BigDecimal getIP(Options o)
throws TVMException
TVMException
java.math.BigDecimal getIE(java.math.BigDecimal nominal,
int period,
Options o)
java.math.BigDecimal getEffectiveRate(Options o)
setEnterRateAsPercent(boolean),
setCompoundingPerYear(int),
setValue(java.math.BigDecimal, com.cedarspring.tvm.Options)