• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Create a date list with "change of conditions"

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys!
I've a complex (maybe) problem with my java application. Pratically, I've a date list (days of month) from a query and a date list (CoC) with a random number of dates.
I'm developing a java application to scan the days of month and write in output all the days of month and the relative date of other list when it changes.
I know, I'm uncleary but I've writed a simple code to make it clear to you. (I'm using JodaTime libs)

This is my (wrong) code:



This is the result:



This is my expected result:



Thanks so much!!
 
Saloon Keeper
Posts: 11067
88
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On line 39 you are using count_coc to get dtJs element. You need an independent index into dtJs.
 
Roberto Tucci
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:On line 39 you are using count_coc to get dtJs element. You need an independent index into dtJs.



Thanks man for reply!
Yes, you're right...Anyway, there is something wrong in the logic of my code. I'm trying other solutions but it's very complex case...I'm losing all hopes...
 
Marshal
Posts: 80666
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Tucci wrote: . . . but it's very complex case. . .

I suspect it isn't. I suspect you have not worked out what the conditions are and not written them down simply and clearly in ordinary English/French/Welsh/Whatever.
 
reply
    Bookmark Topic Watch Topic
  • New Topic