• 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

Schedule a Timer for (starting Date, No of times, no of days) problem

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I have a TimerTask which need to be scheduled for conditions such as

1) Start Date and Time

2) Frequency (no of times it needs to be run)

3) Day/Month/Year

No 3 is actually a combo box in the UI.

If Day is selected then and Frequency is 5 means - Start from the Starting date and run for the next 5 days.

Similarly if Month is selected - Start from the Starting date and run for the next Five months.

Similarly for the year.

Now how can I specify in schedule() method of the Timer object so that it can accomplish the above objective.

Please help me out from this problem.

Thanks for your comments.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you worked out a schedule() call that sets up the first time and how often to run? That looks pretty straightforward if you're accustomed to dealing in times as milliseconds.

I think to make it run a certain number of times and stop you'll have to make the task keep count and cancel itself.
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic