[rules-users] How to traverse the Collection by index

dhari sdhari at hotmail.com
Sun Mar 7 19:04:32 EST 2010


Hi all,
I want to compare all elements in the collection with other element of the
same collection. In my case I have collection of Segment, a Segment contains
startDate and endDate. The whole collection of Segment should consists on
complete calendar year and every segment in the list must start 1+ from the
endDate of last element. Valid fact should be:

MemberShip 
     Segment 1: StartDate: 01-01-2010  EndDate: 30-05-2010
     Segment 2: StartDate: 31-05-2010 EndDate: 08-08-2010
     Segment 3: StartDate 09-08-2010 EndDate: 31-12-1020

Data structure
class Segment{
      java.util.Date startDate;
      java.util.Date endDate;
}
class Membership{
     java.util.ArrayList<Segment> segments;
}

I know the date functions. I just want to know how can I traverse the List
from get element on Index and Index+1? 

-- 
View this message in context: http://n3.nabble.com/How-to-traverse-the-Collection-by-index-tp434756p434756.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list