posted 17 years ago
Hello,
I have a list of Objects. These objects contain the effective date. I want to sort this list of objects and reorder it according to the date. The following is the piece of code I am referring to:
public List getPremiumSchedulesList() {
List returnList = new ArrayList();
Date date = null;
Vector altPremScheduleVector = getAltPremScheduleVector();
Iterator altPremScheduleVectorIterator =
altPremScheduleVector.iterator();
PremiumSchedule premiumSchedule = null;
while (altPremScheduleVectorIterator.hasNext()) {
premiumSchedule = new PremiumSchedule();
AltPremMode altPremMode = (AltPremMode) altPremScheduleVectorIterator.next();
premiumSchedule = populatePremiumSchedule(altPremMode);
date = premiumSchedule.getEffectiveDate();
System.out.println("Effective Date: "+date);
returnList.add(premiumSchedule);
}
return returnList;
}
The premiumSchedule object contains an effective date. I want to sort this list according to the effective date. I would really apprecite if someone can point me in the right direction
Looking forward to your responses.
Thanks,
Kunal