|
| Property | Type | Read | Write | Bound | Default |
|---|---|---|---|---|---|
| compoundingPerYear | int | x | x | x | 12 |
| futureValue | BigDecimal | x | x | x | 0.0 |
| interestRate | BigDecimal | x | x | x | 0.0 |
| message | String | x | x | ||
| numberOfPeriods | BigDecimal | x | x | x | 0 |
| payAtEnd | boolean | x | x | x | true |
| payment | BigDecimal | x | x | x | 0.0 |
| paymentsPerYear | int | x | x | x | 12 |
| presentValue | BigDecimal | x | x | x | 0.0 |
| rateEstimate | BigDecimal | x | x | x | 10.0 |
| roundUp | boolean | x | x | x | true |
| scale | int | x | x | x | 4 |
| Property | Type | Read | Write | Bound | Default | Affects | Uses |
|---|---|---|---|---|---|---|---|
| AmortizationSchedule | Amortization Schedule |
x | compoundingPerYear, interestRate, numberOfPeriods, payAtEnd, payment, paymentsPerYear, presentValue |
||||
| effectiveRate | BigDecimal | x | compoundingPerYear, interestRate, paymentsPerYear |
||||
| enterRateAsPercent | boolean | x | x | x | true | interestRate | |
| years | BigDecimal | x | x | numberOfPeriods / paymentsPerYear | numberOfPeriods | numberOfPeriods |
| Method | Params | Returns |
|---|---|---|
| computeInterestRate() | none | void |
| computePayment() | none | void |
| computePresentValue() | none | void |
| computeFutureValue() | none | void |
| computeNumberOfPeriods() | none | void |
| Method | Params | Returns |
|---|---|---|
| clear() | none | void |
| clearMessage() | none | void |
| reset() | none | void |
| Method | Params | Returns |
|---|---|---|
| addErrorListener() | none | Listener |
| removeErrorListener | none | Listener |
| addPropertyChangeListener | none | Listener |
| removePropertyChangeListener | none | Listener |
message property.oldValue property in the
PropertyChangeEvent is always set to null.
If an error occurs, it will fire an ErrorEvent
and will also set the message property.oldValue in the
PropertyChangeEvent is always set to null.message property. The state (except for
message) does not change when an error occurs. Events are
used instead of exceptions to make visual wiring easier. Refer to IBM´s tutorials:
"Visual programming tutorial - Visual debugging and error handling" and
"Designing beans for visual programming - Handling errors".
The two read-only properties (effectiveRate and AmortizationSchedule) can fire error events since they compute the values only when requested. When an error occurs, an event is fired. The getEffectiveRate method will return 0. The getAmortizationSchedule method will return an empty schedule.
The messages in the Error Events can be customized to fit the jargon of a particular industry or localized for a particular language and country (locale). Since the text of the message may change, you should always use the code (which remains constant) to determine which error occurred. Error W01 is not used in this version.
| Code | Message | Severity |
|---|---|---|
| 01 | Arithmetic error | error |
| 02 | Invalid argument | error |
| 03 | Number of Periods must be a whole number | error |
| 04 | Value out of range | error |
| 05 | No solution exists | error |
| 06 | Range is 0 - 1200 for number of periods | error |
| 07 | Iteration limit exceeded | error |
| 08 | Scale cannot be negative | error |
| 09 | Range is 0 - 999% for interest rate per year | error |
| 10 | No solution found | error |
| 11 | Number of Periods is 0 | error |
| 12 | Range is 0 - 365 for payments per year | error |
| 13 | Range is 0 - 365 for compounding periods per year | error |
| 14 | Effective Rate must be > 0 | error |
| W01 | Number of Periods was rounded to a whole number | warning |
The signs for present value, future value, and payment follow the cash flow convention where money that you invest (money flowing out) is negative and money that you receive is positive. For example, you apply for a $100,000 mortgage and agree to monthly payments with a final (balloon) payment of $50,000 at the end of 15 years. You must enter the present value as 100,000 since you receive that amount from the mortgage company. You must enter -50,000 into future value since you will pay out that amount as a lump-sum at the end of the loan. When you calculate the monthly payment, it will be a negative amount since it is money flowing out each month. There must be at least one positive and one negative cash flow in each financial transaction.
See the JavaDocs for more detail about the bean interface, and concepts for more information about time value of money.
| Copyright ©1998-2003 Cedar Spring Software, Inc. All Rights Reserved Privacy | Legal & Terms of Use | Trademarks | Feedback | About |