com.cedarspring.tvm
Class NumberOfPeriods

java.lang.Object
  |
  +--com.cedarspring.tvm.NumberOfPeriods
All Implemented Interfaces:
java.io.Serializable

final class NumberOfPeriods
extends java.lang.Object
implements java.io.Serializable

Number of Periods
Periods are evenly-spaced intervals of time. They are intentionally not stated in years since each interval must correspond to an interest compounding period.

This class will:

Version:
1.2.2 15-May-2003
Author:
Cedar Spring Software, Inc.

Nested Class Summary
(package private)  class NumberOfPeriods.SolveN
           
 
Field Summary
(package private) static long serialVersionUID
           
private static java.math.BigDecimal UPPER_LIMIT
           
private  java.math.BigDecimal value
           
 
Constructor Summary
(package private) NumberOfPeriods()
           
 
Method Summary
(package private)  void computeValue(java.math.BigDecimal ip, java.math.BigDecimal pmt, java.math.BigDecimal fv, java.math.BigDecimal pv, boolean end, Options o)
          compute number of periods given interest, pmt, fv and pv The result will be rounded to an integer
private  java.math.BigDecimal fxEq0(java.math.BigDecimal x1, java.math.BigDecimal x2, Solve s, Options o)
          Solves f(x) = 0 by binary bisection
(package private)  java.math.BigDecimal getValue()
          Recall number of periods
(package private)  void setValue(java.math.BigDecimal newValue)
          Store a new value for number of periods.
 java.lang.String toString()
          Return numberOfPeriods as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

private java.math.BigDecimal value

UPPER_LIMIT

private static final java.math.BigDecimal UPPER_LIMIT

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

NumberOfPeriods

NumberOfPeriods()
Method Detail

setValue

void setValue(java.math.BigDecimal newValue)
Store a new value for number of periods.


getValue

java.math.BigDecimal getValue()
Recall number of periods


computeValue

void computeValue(java.math.BigDecimal ip,
                  java.math.BigDecimal pmt,
                  java.math.BigDecimal fv,
                  java.math.BigDecimal pv,
                  boolean end,
                  Options o)
compute number of periods given interest, pmt, fv and pv The result will be rounded to an integer


toString

public java.lang.String toString()
Return numberOfPeriods as a string

Overrides:
toString in class java.lang.Object

fxEq0

private java.math.BigDecimal fxEq0(java.math.BigDecimal x1,
                                   java.math.BigDecimal x2,
                                   Solve s,
                                   Options o)
                            throws TVMException
Solves f(x) = 0 by binary bisection

TVMException