• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Check Date span

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys I need some help tackling a problem.
I am trying to compare different date spans and then try to coalesce them (merge them)
this is the contructor of the DateSpan class I was provided with
public DateSpan(Date start, Date end)
throws IllegalArgumentException
{
if (end.before(start)) {
throw new IllegalArgumentException("End date " + end + " is before start date "
+ start);
}
setStart(start);
setEnd(end);
}
these datespan object are then wrapped with another object and then put in a List.

Now for a certain object we can have different datspans.
If these date spans intersect or over lap I have to merge them all together and show just one DateSpan starting from earliest to the latest Date.
I would appreciate some input this
Thanks
Farooq
sfa77@yahoo.com
 
reply
    Bookmark Topic Watch Topic
  • New Topic