• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Need help with collection

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Collection<Box> , I need to extract certain row from this collection base on some criteria. If number, name are the same, using the most recent statusDate (Date)

Ex:


Sincerely thanks and please help!!!
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your fist step is to figure out how you would do it "manually." What information do you need to keep track of? What operations do you need to perform? What decisions do you make? Describe the steps as precisely, thoroughly, and simply as possible, without regard to Java or computers--just as a general set of instructions. Once you have that, if you've done it correctly, translating it to Java will be relatively easy.
 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Your fist step is to figure out how you would do it "manually." What information do you need to keep track of? What operations do you need to perform? What decisions do you make? Describe the steps as precisely, thoroughly, and simply as possible, without regard to Java or computers--just as a general set of instructions. Once you have that, if you've done it correctly, translating it to Java will be relatively easy.



Yes, I tried to, but still need some help....
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jay lai wrote:


Your fist step is to figure out how you would do it "manually." What information do you need to keep track of? What operations do you need to perform? What decisions do you make? Describe the steps as precisely, thoroughly, and simply as possible, without regard to Java or computers--just as a general set of instructions. Once you have that, if you've done it correctly, translating it to Java will be relatively easy.



Yes, I tried to, but still need some help....



I can't help you unless you show some effort and ask a more detailed question. What did you try? Where did you get stuck?
 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 375
1
Python Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only keep your codes inside your CodeTags for better readability..
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By overriding Comparator OR Comparable interfaces methods you can achieve sorting your collection.Google the interfaces.
 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

PrasannaKumar maddu wrote:By overriding Comparator OR Comparable interfaces methods you can achieve sorting your collection.Google the interfaces.



The collection already sorted. The problem is I have the code above tryign to extract out 1 record of each name, number if they are similar




 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there are multiple way you can handle this issue.

[MODERATOR ACTION: Deleted fully coded solution.]

K Abhijit, please remember that this site is NotACodeMill, and LetThemDoTheirOwnHomework. Thank you!
 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K Abhijit wrote:there are multiple way you can handle this issue.

[MODERATOR ACTION: Deleted fully coded solution.]

K Abhijit, please remember that this site is NotACodeMill, and LetThemDoTheirOwnHomework. Thank you!



This site used to be a good, and construtive forum back there., that where people got stuck and ask for it. It is getting worse now!!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic