com.cedarspring.tvm
Class AmortizationSchedule

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

public class AmortizationSchedule
extends java.lang.Object
implements java.io.Serializable

The Amortization Schedule is a list of Amortization objects, each containing the principal, interest, and ending balance for one payment period.

The presentValue (beginning balance) and payment fields are rounded to the current value of scale before the schedule is created. The interest per period is then multiplied by balance to determine the interest for this period and the new balance. Due to rounding, the final balance may not be exactly zero. This class is normally constructed and returned by the getAmortizationSchedule() method of the TVM bean as a read-only object.

Version:
1.2.2 15-May-2003
Author:
Cedar Spring Software, Inc.
See Also:
Serialized Form

Field Summary
private  Options o
          options
private  int periods
          periods
private  java.math.BigDecimal[][] schedule
          Amortization Schedule
(package private) static long serialVersionUID
           
 
Constructor Summary
(package private) AmortizationSchedule()
          Create a new empty Amortization Schedule object.
(package private) AmortizationSchedule(java.math.BigDecimal presentValue, java.math.BigDecimal payment, java.math.BigDecimal ip, boolean payAtEnd, int periods, Options options)
          Create a new Amortization Schedule containing the principal, interest, and balance for each period.
 
Method Summary
 Amortization getAmortization(int period)
          Get an Amortization object for a single period.
 Amortization getAmortization(int period1, int period2)
          Get an Amortization object for a range of periods.
 java.util.Enumeration getAmortizations()
          Gets an enumeration of the periods in this schedule.
 int getPeriods()
          Get the number of payment periods in the schedule.
 boolean isEmpty()
          Test if the Schedule is empty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schedule

private java.math.BigDecimal[][] schedule
Amortization Schedule


o

private Options o
options


periods

private int periods
periods


serialVersionUID

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

AmortizationSchedule

AmortizationSchedule()
Create a new empty Amortization Schedule object.


AmortizationSchedule

AmortizationSchedule(java.math.BigDecimal presentValue,
                     java.math.BigDecimal payment,
                     java.math.BigDecimal ip,
                     boolean payAtEnd,
                     int periods,
                     Options options)
Create a new Amortization Schedule containing the principal, interest, and balance for each period.

Parameters:
presentValue - The beginning balance.
payment - Payment for each period.
ip - Interest rate per period. Enter as a decimal (i.e 1% is entered as .01)
payAtEnd - Are payments made at end of period?
periods - The number of periods.
options - scale and rounding.
Throws:
java.lang.IllegalArgumentException - if a reference to an object is null or if ip or periods is negative.
Method Detail

getAmortization

public Amortization getAmortization(int period)
Get an Amortization object for a single period. The amortization contains the principal and interest paid and the ending balance for this period.

Periods are numbered from 1 - periods.

Returns:
Amortization Amortization for one period
Throws:
java.lang.IndexOutOfBoundsException - if schedule is empty or index is < 1 or > periods.

getAmortization

public Amortization getAmortization(int period1,
                                    int period2)
Get an Amortization object for a range of periods. The amortization contains the total principal and interest paid during the range of periods and lists the balance at the end of the last period.

Periods are numbered from 1 - periods.

Returns:
Amortization Amortization for period1 - period2.
Throws:
java.lang.IndexOutOfBoundsException - if schedule is empty or an index is < 1 or > periods.
java.lang.IllegalArgumentException - if period1 > period2

getPeriods

public int getPeriods()
Get the number of payment periods in the schedule.

Returns:
periods number of payment periods

isEmpty

public boolean isEmpty()
Test if the Schedule is empty

Returns:
true if the schedule is empty

getAmortizations

public java.util.Enumeration getAmortizations()
Gets an enumeration of the periods in this schedule.

Returns:
Enumeration Enumeration of periods in this schedule. Each period contains one Amortization object with principal, interest and balance for the period.
Since:
TVM 1.2.1