Advice on how to solve problem

I need to compare two lists against each other. If they both contain the same key then I need to compare each of their values for said key. Based on the values I need to take certain action.
My problem is with checking the keys against each other in the lists.
I have tried the following three solutions but they are not producing my desired results. I guess I am not sure how I cant take one item from listA - check all of listBs keys against it and then move on to another key in listA... Any help would be appreciated.
Here are the two lists I am using in this example. I know i and q are not good names but I am just in development right now - I will change them once I have it working.
i{20051004-01=1, 20051014-01=1, 20051017-01=2, 20051017-02=1}
q{20051017-01=1, 20051017-02=1}
solution one
while(ita.hasNext()) {
    Map.Entry entry = (Map.Entry)ita.next();
    Object ikey = entry.getKey();
    Object ivalue = entry.getValue();
    Integer ival = (Integer) ivalue; // cast primitive from object to int.
    int iv = ival.intValue();
     System.out.println("ikey" + ikey);
     while(itb.hasNext()) {
         Map.Entry entry2 = (Map.Entry)itb.next();
         Object qkey = entry2.getKey();
         Object qvalue = entry2.getValue();
         Integer qval = (Integer) qvalue; // cast primitive from object to int.
         int qv = qval.intValue();
         System.out.println("qkey" + qkey);  
         if(ikey.equals(qkey)) {
              System.out.println("ikey + qkey _ THE KEYS EQUAL!"
              + ikey +" AND " + qkey);
         } else {
             System.out.println("ikey + qkey _ THE KEYS DO NOT EQUAL!"
             + ikey +" AND " + qkey);  
STDOUT OUTPUT
ikey20051004-01
qkey20051017-01
ikey + qkey _ THE KEYS DO NOT EQUAL!
    20051004-01 AND 20051017-01
qkey20051017-02
ikey + qkey _ THE KEYS DO NOT EQUAL!
    20051004-01 AND 20051017-02
ikey20051014-01
ikey20051017-01
ikey20051017-02
solution two
do{
     if(ita.next().equals(itb.hasNext())) {
         System.out.println("ita.next() + itb.next()_ THE KEYS EQUAL!"
         + ita.next() +" AND " + itb.next());
     } else {
         System.out.println("ita.next() + itb.next() _ THE KEYS DO NOT
         EQUAL!" + ita.next() +" AND " + itb.next()); 
} while(ita.hasNext());
STDOUT OUTPUT
ita.next() + itb.next() _ THE KEYS DO NOT EQUAL!
     20051014-01=1 AND 20051017-01=1
ita.next() + itb.next() _ THE KEYS DO NOT EQUAL!
     20051017-02=1 AND 20051017-02=1
solution three
while(ita.hasNext()) {
     if(ita.next().equals(itb.hasNext())) {
          System.out.println("ita.next() + itb.next()_ THE KEYS EQUAL!" +
          ita.next() +" AND " + itb.next());
     } else {
         System.out.println("ita.next() + itb.next() _ THE KEYS DO NOT
         EQUAL!" + ita.next() +" AND " + itb.next()); 
STDOUT OUTPUT
ita.next() + itb.next() _ THE KEYS DO NOT EQUAL!
     20051014-01=1 AND 20051017-01=1
ita.next() + itb.next() _ THE KEYS DO NOT EQUAL!
     20051017-02=1 AND 20051017-02=1Thanks in advance for all help. Someday I hope this will finally click for me.
Crystal

I agree with the last post. The itb is all used up after the first element of i is checked. Reset the iterator for itb so that all of q will be checked for each element of i.

Similar Messages

  • How to solve problem - " Safari cannot open page because it isn't connected to the internet" but the airport is ok. signal full and i have n IP address.

    How to solve problem - " Safari cannot open page because it isn't connected to the internet" but the airport is ok. signal full and i have n IP address. and i m using Macbook pro.
    OS snow leopard and above...

    Do you have this problem with all websites, or only some? If only some, which ones?

  • How to solve  problem :- rep-188-Report Server acccepts only Batch jobs

    How to solve problem :- rep-188-Report Server acccepts only Batch jobs
    Report server :- 10gR1

    Hello,
    Could you give us some details about the command line ?
    What is the value of DESTYPE ?
    Regards

  • Use CS4. Switch from Win OS to Mac OS X. Download CS4 on iMac. But old product key is not recognised. How to solve problem?

    Use CS4.
    Switched computer with Win OS to iMac computer with OS X.
    Downloaded CS4 on iMac.
    But old product key entered is not recognised.
    How to solve problem?

    There is nothing to resolve. Serial numbers are platform specific, but platform swaps only apply to current versions, meaning CS&. Your CS4 is not eligible for an upgrade, so your only option is to buy a new CS6 license or sign up for Creative Cloud.
    Mylenium

  • HT204266 how to solve problem 'your apple id has been disable'?

    how to solve problem 'your apple id has been disable'?

    Depending on why it's been disabled, you might be able to re-enable it via this page : http://appleid.apple.com
    Or you might need to contact Apple : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • After update iPhone4 to iOS6, its stuck, showing only USB to iTunes on the screen. What to do, how to solve problem, help

    after update iPhone4 to iOS6, its stuck, showing only USB to iTunes on the screen. What to do, how to solve problem, help 

    Connect your phone to iTunes on your computer like the diagram has indicated and restore the phone

  • The file "Acceptance Letter.pages" doesn't exist. Since installing Yosemite on MacBook Pro I cannot save or export from Pages. Just get the message at beginning of this post. How to solve problem?

    I cannot save or export from Pages since installing Yosemite on MacBook Pro . I just get the message at beginning of this post “Acceptance Letter.pages” doesn’t exist or whatever file title I have inserted How to solve problem?

    Thanks Peter but I was not seeking to store with I-Cloud. In fact I never store documents with I-cloud.
    I was in fact trying to store the files to Documents, which is where I usually keep such things.
    Have now discovered that if I leave the file untiled and simply close it, rather than saving it then it will save, oddly, to Documents. I then have to re-title it and move to the folder I want it in.
    Despite the above, even once it is titled and saved in Documents then if I reopen it I still cannot then Export it to a Word or PDF file. I still just get the message . xxxxxx.pages does not exist!
    Bad news as I am constantly exporting documents to Word and PDF to send to others who do not use a Mac

  • How to solve problem occur in display

    how i solved this problem in my laptop

    Per,
    maybe this information could be helpful to solve my issue. I used your queries from On queue processing, or the lack thereof. Part #2 :
    select
    count(P.mskey) numEntries,t.taskid,t.taskname,A.Name ActionType,s.name StateName,
    case when js.name = 'Running' then 'Running, processed:'||to_char(NVL(J.CurrentEntry,0)) else js.name end as Jstate
    from
    mxp_provision P
    inner join mxp_Tasks T on T.taskid = P.actionid
    inner join mxp_state S on S.StatID = P.state
    inner join MXP_ActionType A on A.ActType=P.ActionType
    left outer join mc_jobs J on J.JobGuid = T.JobGuid
    left outer join mc_job_state JS on j.State = JS.State
    group by
    t.taskid,T.taskname, A.name, S.name,case when js.name = 'Running' then 'Running, processed:'||to_char(NVL(J.CurrentEntry,0)) else js.name end
    order by
    A.name, S.name
    and got result - I have big Queue for Modify task:
    What I have to do with such Queue? How to reset it?
    Best regards,
    Natalia.

  • There's something wrong with my device. Unable to check updates and couldn't download or install any application from the AppStore .please advice me how to solve this problem .

    unable to check updates and couldnt download or install any application

    Hi, mayca07.  
    Thank you for visiting Apple Support Communities. 
    I would need more information regarding the exact issue or errors received to provide a better answer.  However, there are a couple things that I would recommend trying.  Try forcing all open applications to close and restart the device.  Next, go through the section labeled Troubleshoot issues on an iPhone, iPad, or iPod touch in the second article below.  
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Cheers,
    Jason H.

  • How to solve problems concerning facebook videos+flash player?

    dear friends, I have a problem I hope you could solve; since two days ago, when I try to look a video uploaded on facebook, it appears an advice saying that it's necessary to upgrade my flash player...I have an ibook g4 powerpc, tiger 10.4.1, and when I try to go to the download section - your site - I only find upgradings concerning intel processors...but mine is a powerpc...!! how can I solve the problem? please help me!! many thanks in advance!!

    Hello, Adobe no longer supports pre-Intell Macs. Here is an "unsupported" link that worked for me. Good Luck... http://www.steelbin.com/FPforFBPPC.zip

  • Firefox crashes when opening any Adobe pdf document from internet. This only seems to happens with firefox 6.0.2. Pls assist how to solve problem

    Good day,
    Please note Firefox is crashing every time I tried to open a pdf document I find in any internet webside. This is happening since I have installed Firefox 6.0.2. I temporarily solved the issue going back to Firefox 5. The problem is that my Mac installs automatically all the updates that might come from Firefox, including new or greater versions.... So, here I am again with Firefox 6.0.2 and not able to open Adobe pdf documents.....
    Would you please kindly assist to fix this issue...? Please note I have systematically sent a report every time Firefox has crashed, so you might have quite a few by now!
    Many thanks in advance for all your help and assistance.
    Francesca.

    * Preferences that have been modified are shown as '''bold (user set)'''.
    * Preferences can be '''Reset to the default''' or changed via the right-click context menu.
    The preferences on which Reset is greyed (not available), are they appearing in Bold Text or Normal ??

  • How to solve problem with Installer Package for itunes

    Hi! I'm attempting to upadte itunes so I can get the latest software for my iphone. It's a 3GS. Every time when ready to instal it says I have a problem with the installer package  -  something is missing. What can I do to solve this?

    Repair your Apple software update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you don't find ASU, go to Control Panel:
    START > CONTROL PANEL >
    Add n Remove Programs(XP)
    Programs n Features(Win7/Vista)
    highlight ASU and click CHANGE then REPAIR,

  • How to solve problem After patch 10.2.0.4 applying on owb 10.2.0.1

    HI OWB Gurus,
    We have recently a patchapplied for oracle 10g .
    prev version was oracle 10 g r2 10.2.0.1
    new version is 10.2.0.4 ( patchset 4)
    After patch applied at database and owb level there are some problem we are facing like
    ETL process is very slow , cpu is going to 100% after start any mapping.
    and audit browser are not opening.
    Can any one help me on this so that we can resolve the problem.
    - Umesh

    Hi Umesh,
    This might help you in diagnosing the client's performance
    Accurate optimizer statistics are generally very important. They are gathered automatically at OWB install time and the Design Center -> Tools -> Optimize Repository menu selection is available to refresh them on an as needed basis.
    The DBA can always help by pre-expanding tablespaces, making sure multiple tablespaces are available on separate disks or disk arrays so that I/O to indexes, metadata tables, snapshot tables, DB undo and redo logs, etc., can be evenly distributed.
    With more complex metadata in this OWB release, you can expect many JDBC round-trips to the DB. Network latency can have a big impact on performance. To see how much time the owbclient uses for JDBC roundtrips to the DB, add the following line to Preference.properties in <owb home>/owb/bin/admin on your client machine:ClientProfile=true
    Run OWB, then check ClientProfile.log in the admin directory. Keep in mind that a ping to localhost is probably about 0.025 ms, to another machine in the LAN about 0.25 ms. If the roundtrips are greater than 40 ms, then the issue is likely related network latency.
    The two basic workarounds for network latency are:
    -Remote control an OWB client machine that is physically close to the server.
    -Do design-time work on a local repository, then MDL export the work for import to a central repository.
    If the client and server are not on the same (high bandwidth) LAN, then total available bandwidth may become a factor. Same thing if the DB server is heavily loaded with respect to CPU or I/O, or if all your OWB design-time metadata is located on the same tablespace on the same hard drive. Distributing projects across multiple repositories which use their own
    tablespaces spread across multiple hard drives would be very desirable.
    The object editors are more functional and complex, as such, the required processing power to render them is greater (processor > 2GHz) Also note the OWB client software is mostly single-threaded, so it won't take advantage of multiple processors on one machine.
    Long running sessions or large bulk operations (MDL import, validation, generation, deployment over large or multiple modules) can push up against the JVM memory limit. If performance begins to suffer due to memory, either:
    a)exit and restart the OWB session;
    b) if adequate physical memory exists, increase the -Xmx and -Dlimit values in the owbclient and OMBPlus startup scripts to better accommodate large operations.
    ie.
    If you have 2 GB or more, backup and edit owb\bin\win32\owbclient.bat file and modify line starting with %JAVAPATH
    ie.
    %JAVAPATH%\jre\bin\java -Xms128M -Xmx1024M -Dlimit=1024M -XX:MaxPermSize=1024M
    This will add more memory to JVM for OWB client. Do the same for owb.cl file
    Hope this will add some value.
    Best Regards,
    Prasad Bolla.

  • Grey screen with apple logo and buffering how to solve problem ?

    When starting my mac book pro it comes up with the grey screen with the apple logo and the buffering symbol , I have tried to reboot in safe mode and that doesn't work. I do not have my installation disc for the OS X 10.7.5 and was wondering if I used an external hard drive to back up all my files and then got a lion installation USB from amazon, would that solve my problem and make sure I don't lose my files ? Do you have any other suggestions ?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Boot in safe mode. First, disconnect all wired peripherals except keyboard, mouse, and monitor, if applicable. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    During startup, you will see "Safe Boot" on the login screen, which appears even if you normally log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Safe mode is slower than normal, and some things won’t work at all, including your login items.
    Same problem?
    After testing, reboot as usual (i.e., not in safe mode.)

  • How to solve problem error code 0x610000f6 7500A All in one

    I have cleared paper jam turned off and on power. Restarted printer tried removing cartrages and I still have this error any ideas on how to get it to stop and work right

    This article should help resolve the error you are getting:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03081973&cc=us&dlc=en&lc=en
    Give the steps a try and let us know if it helps.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

Maybe you are looking for

  • Top Level folder doesn't show lowver level pictures - Lightroom2

    I have my pictures stored by year and location on a hard drive    example 2009     Heaven        April     Hell          April As I remember each upper level would show the counte of sub folders which allowed me to do sorts on ratings and the like No

  • CR runtime for VS2010 (v13) not generating report

    I installed Crystal Reports Runtime for VS2010 version 13 on Win2003 Server 64 bit (for intranet website that is used to execute reports). The web site is executed under Integrated security. The user account and the network service account have write

  • Ipad will not restart after new ios download and i cannot open it as it asks dfor passcode-I've no idea what this is

    My Ipad keeps asking for my passcode- it is connected to my computer and I have updated my password.-ipad does not recognise this! What should I do?

  • Elements 12 photomerge-Panorama

    When selecting Photomerge Panorama in Elements 12, program crashes with error message "editor 12 has stopped working". Was working fine until last week then suddenly this started happening every time I attempt to run Panorama. Other Photomerge functi

  • Matching list in dropdown prompt

    Hi, I have a requirement that when a user starts typing a letter in the dropdown, all the matching list has to appear as a dropdown. Can anyone please let me know whether its possible or not in obiee 10g? For ex: if a user is searching for ayzsdc0005