Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
    Bookmark Topic Watch Topic
  • New Topic

comparing arraylist elements  RSS feed

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have an arraylist, clientList, which holds an array of clientRecords which has a string value of a sequence number. I also have an arraylist, policyList, which holds an array of policyRecords which has a string value of a sequence number. I am trying to figure out how to compare the two sequence numbers against both arraylist?

ArrayList clientList ArrayList policyList
Object[0] clientRecord Object[0] policyRecord
String sequenceNumber = "1" String sequenceNumber = "2"
String companyText = "AFG" String policyNumber = "F12"
Object[1] clientRecord Object[1] policyRecord
String sequenceNumber = "2" String sequenceNumber = "2"
String companyText = "FFD" String policyNumber = "WW1"
Object[2] clientRecord Object[2] policyRecord
String sequenceNumber = "3" String sequenceNumber = "1"
. .
. .
. .

I can not figure out how to get down to the level of the elements of the records?

Any help would be appreciated.
Thanks in advance.
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Report post to moderator
It's not clear to me what you are trying to return. Are you trying to find sequence numbers that are in both lists?
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Report post to moderator
duplicate posting: http://www.coderanch.com/t/384023/java/java/comparing-arraylist-elements
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!