C
C.Thomson
I have an application in which I have a list of business objects that
hold repeating coupon data about mortgage information. Each record
contains the following fields:
BeginDate,EndDate,Rate,Cap,Floor,DayCount
There can be any number of records for each trade. For instance, here
is a trade with 3 coupons:
11/05/04 - 07/04/05 Raterime minus 0.5
Cap:8.0%
Floor:0.0%
DayCount:30/360
07/05/05 - 09/04/06 Rate:3.0%
Cap:
Floor:0.0%
DayCount:30/360
09/05/06 - 11/04/08 Rate:4.0%
Cap:
Floor:0.0%
DayCount:30/360
I have a coupon object with getters/setters for each field listed. I
have an ArrayList that stores that coupon data. What I am trying to
do is add a new entry that holds the repeating data that does not
change over the life of the trade. From the example above, the added
object would hold:
11/05/04 - 11/04/08 Floor:0.0%
DayCount:30/360
I have a method of doing this by iterating over the list and comparing
each field and saving duplicates to a new object. I am just wondering
if there is an easier/more sophisticated way of doing this.
Thanks.
hold repeating coupon data about mortgage information. Each record
contains the following fields:
BeginDate,EndDate,Rate,Cap,Floor,DayCount
There can be any number of records for each trade. For instance, here
is a trade with 3 coupons:
11/05/04 - 07/04/05 Raterime minus 0.5
Cap:8.0%
Floor:0.0%
DayCount:30/360
07/05/05 - 09/04/06 Rate:3.0%
Cap:
Floor:0.0%
DayCount:30/360
09/05/06 - 11/04/08 Rate:4.0%
Cap:
Floor:0.0%
DayCount:30/360
I have a coupon object with getters/setters for each field listed. I
have an ArrayList that stores that coupon data. What I am trying to
do is add a new entry that holds the repeating data that does not
change over the life of the trade. From the example above, the added
object would hold:
11/05/04 - 11/04/08 Floor:0.0%
DayCount:30/360
I have a method of doing this by iterating over the list and comparing
each field and saving duplicates to a new object. I am just wondering
if there is an easier/more sophisticated way of doing this.
Thanks.