This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with collection

 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • 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!!!
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
 
R. Jain
Ranch Hand
Posts: 375
1
Java Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only keep your codes inside your CodeTags for better readability..
 
PrasannaKumar maddu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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




 
K Abhijit
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • 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
  • 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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic