1 | <?php |
||
12 | abstract class BondCalculatorAbstract extends CalculatorAbstract |
||
13 | { |
||
14 | // face value of the bond = 'F' |
||
15 | protected $bondFaceValue; |
||
16 | // coupon rate of the bond per annum = 'c' |
||
17 | protected $bondAnnualCouponRate; |
||
18 | // number of years to the maturity of the bond |
||
19 | protected $bondYearsToMaturity; |
||
20 | // frequency of bond payments (expressed in a divisor of 12 months ~ 1 year) |
||
21 | // e.g.: divisor 2 means semi-annual payments |
||
22 | protected $bondPaymentFrequency; |
||
23 | |||
24 | /** |
||
25 | * @param $bondFaceValue |
||
26 | */ |
||
27 | public function setBondFaceValue($bondFaceValue) |
||
33 | |||
34 | /** |
||
35 | * @param $bondAnnualCouponRate |
||
36 | */ |
||
37 | public function setBondAnnualCouponRate($bondAnnualCouponRate) |
||
43 | |||
44 | /** |
||
45 | * @param $bondYearsToMaturity |
||
46 | */ |
||
47 | public function setBondYearsToMaturity($bondYearsToMaturity) |
||
53 | |||
54 | /** |
||
55 | * @param $bondPaymentFrequency |
||
56 | */ |
||
57 | public function setBondPaymentFrequency($bondPaymentFrequency) |
||
63 | |||
64 | /** |
||
65 | * @return mixed |
||
66 | */ |
||
67 | public function getBondFaceValue() |
||
71 | |||
72 | /** |
||
73 | * @return mixed |
||
74 | */ |
||
75 | public function getBondAnnualCouponRate() |
||
79 | |||
80 | /** |
||
81 | * @return mixed |
||
82 | */ |
||
83 | public function getBondYearsToMaturity() |
||
87 | |||
88 | /** |
||
89 | * @return mixed |
||
90 | */ |
||
91 | public function getBondPaymentFrequency() |
||
95 | |||
96 | /** |
||
97 | * @return float |
||
98 | */ |
||
99 | public function getCouponPayment() |
||
103 | |||
104 | /** |
||
105 | * @return int |
||
106 | */ |
||
107 | public function getBondNoOfPayments() |
||
118 | } |
||
119 | } |
||
120 |