Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Practical Use for Calendar roll() method?

 
Ranch Hand
Posts: 271
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was trying out Calendar methods, most useful to me seems to be the add() method. If I want to linearly plot an event , e.g. a coffee dripolator or a medicated saline infusion into a patient every delta, the increment to be in delta seconds interval in a do-while loop, then this is what I would do.



QUESTION: How would I use roll()? Can you please give me a practical example as per above?

I was playing with my Android and the only practical use seems to be rolling from 12/10/2015 to 1/10/2016 when I swipe the calendar app screen.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

AhFai Chan wrote:QUESTION: How would I use roll()? Can you please give me a practical example as per above?


As I recall, roll() does not take normal calendar rules into account (unllike add()), so you can use it to, for example update a Calendar to send out a bill on the 25th of NEXT month, without having to worry about how many days the month has, or whether it's a leap year etc.

29th of next month might be a problem though.

HIH

Winston
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic