HELP!! Can't read a map within a map

Hey guys. I've been stuck on this issue for quite some time now and I haven't been able to figure this out. My structure that I am storing data in is in a map within a hashmap so its looks like the following
< k , <k,v>>
or in my case
<String, <Integer, Integer>>
and I want to iterator over each string pulling out all the map values or (<Integer, Integer>)
also each string has several <intger,integer> values in it.
<String, <Integer, Integer>>
<Ingeter,Integer>>
<Integer,Integer>>
So i thought about using a for each loop and using the Map.EntrySet
but I really don't know how to do this or understand it. Can someone clarify this up for me?
Thanks in advance.

what exactly does the iterator function do, if you don't mind me asking?You might find it useful to have a look at Sun's Tutorial on Collections. iterator() is dealt with near the start.
Your original post asked about how to use a for loop with the entry set. I realise I didn't address that. The following show similar ways of traversing a map:
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class IteratorEg {
    public static void main(String args[]) {
        Map<String,Integer> data = new HashMap<String,Integer>();
        data.put("first", 1);
        data.put("second", -1);
        data.put("last", 0);
        Iterator<String> it = data.keySet().iterator();
        while(it.hasNext()) {
            String key = it.next();
            int value = data.get(key);
            System.out.println(key + " --> " + value);
        for(String key :data.keySet()) {
            int value = data.get(key);
            System.out.println(key + " --> " + value);
        for(Map.Entry<String,Integer> entry :data.entrySet()) {
            System.out.println(entry.getKey() + " --> " + entry.getValue());
}As you can see either the key set or the entry set can be used. (It being a map there is an exact 1-1 correspondence between the keys and the entries.) And they can be traversed (gone through) using either the iterator that they provide, or using the new for loop syntax.

Similar Messages

  • I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome.

    I removed chrome 10 and newly installed FF4 final, and I can't read PDF files within the browser. There was no problem in Chrome. I can't even see the acrobat reader plugin in the plugins page. Acrobat 10 is already installed in my PC. Every time I try to read a PDF file on the web, FF tries to download it instead.

    As recommended above by Bernd Alheit, I posted this on the Adobe Reader forum. There, I received the advice to repair the installation under the help menu, which I did and it fixed the problem.
    Similar to your solution but found it's a fix found under "HELP" menu and not Add/Remove.
    Thank you.

  • I Need your help, can you read and help me? Thank You

    I purchased a macbook pro retina in December 2014 , Yosemite original . I need instead of Mavericks 10.9.5 to use protools 10. I do not know how to download the installer of mavericks . My girlfriend has a macbook pro retina instead of 2013 with Mavericks . I might download to you by your computer the installer on a USB 16-gigabyte , but we do not know where to find the installer of mavericks on his computer . Can you help ?

    Either connect a regular external drive to the older MacBook Pro or use the Disk Utility to partition the new one's internal drive, connect the two computers through FireWire or Thunderbolt, restart the new one with the T key held down, start the older one from the recovery partition(press the Command and R keys at startup), and install the OS.
    If you're actually able to download the installer from the Mac App Store, you can use it instead of restarting from the recovery partition.
    (125224)

  • Can't read any file within a disk image

    A year ago I created a disk image with a few thousand files in as an archive. Periodically I open it and access the files.
    Now when I open the dmg, I see all the folders and files, but none of them are usable. No application can open them, for example opening a jpg in Preview yields the message " The file “Picture 1.jpg” could not be opened. It may be damaged or use a file format that Preview doesn’t recognize. " I get similar meesages from Word, Acrobat, etc. for their files. Basically it appears that every file in the dmg is corrupt.
    I have run Disk Utility Repair which said no repair needed; I have run DiskWarrior which found and fixed problems; neither made a difference.
    Any suggestions? Running 10.6.8.
    Thanks

    Sorry that I'm late to this party, but in case somebody else comes by this thread, this is the way to measure the voltage from the 20V plugs:
    http://www.kawakami-ca.com/images/20v_dc_plug.jpg
    Ray Kawakami
    X22;X24;X31;X41;X41T;X60;X60s;X61s;X300;X301;Z60m;Z61t;Z61p;560Z;600E;600X;T21;T22;T23;T41;R50;A21p;A22p;A31 and A31p
    Not a Lenovo employee; just a volunteer helping out here
    All personal links to PC-Doctor software removed 8/2012 by mfg request

  • How can I read mail attachment for making it to the payload?

    Hi everybody,
    in the following my scenario:
    I have an incoming message with attachment by the mail sender adapter using PayloadSwapBean (because of other messages I have to use the bean). I want to send this attachment by using the mail receiver adapter to fix E-mail-address keeping the FromMailAddress, the MailSubject and the FileName
    without the metadata as additional attachment.
    I have found a thread where it is explained how to handle "payload as mail attachment and dynamic filename" by java-mapping. So far so good. My question is: How can I make my attachment to be the payload? How can I read the attachment by java-mapping?
    Thanks for help.
    Reagrds,
    Sebastian Linke

    USe payloadSwapBean for this to swap your payload and attachment
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Rajesh
    Edited by: Rajesh on Feb 5, 2009 5:29 PM

  • Reading files from within helper classes

    From within a servlet, I can get the servlet context to get a path to the "web" directory of my project and easily access properties files for my project. If I create another package in my project to hold helper classes that perform some specific function and want to create and/or read from a properties file, I get a path to the bin directory of my servlet container:
    Servlet Path: D:\Documents and Settings\Josh\My Documents\Josh\Projects\ServletSandBox\build\web\
    Helper Class File Path: D:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\bin\test
    I'd like to develop my helper packages as reusable APIs, so they're not tied directly to my project or to a servlet in general, but I'd like the properties files to stay somewhere in my project folder, preferably in the WEB-INF directory with the servlet's own specific properties file.
    I can't figure out the best way to handle this. I wanted to just be able to pass the helper class a String if somebody wanted to specify a filename other than the default filename. Does it make sense to specify a file URL instead? Is there any other way to get the calling servlet's context path without having to pass in a variable?
    Thanks

    It seems that the helper API shouldn't need to be given a path to its own config file. I would like to have code that will load the file regardless of whether or not its in a stand alone java app or a servlet. Whenever the helper API is jarred up and imported into my servlet, it can't find the config file unless it's in the "D:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.14\bin\test" directory. OR, if I use the current thread to get the loader, it will locate it in the "classes" folder, which is the only solution I can come up with that will let me write code to load the file that will work, regardless of its implementation.
    The "project" folder I'm talking about is just the NetBeans "project" folder for the servlet, or the "ServetSandBox" folder in my example. I guess that doesn't really matter in the context of the servlet though.
    So is using the current thread the appropriate way to do this? When you say that code will work if I put the resource in the WEB-INF directory, that seems to only be true if I try to load it from the servlet itself, not the helper class. The helper class doesn't find the resource in the WEB-INF directory.
    Also, I would like to be able to write the default values to a new config file if one doesn't exist. How in the heck do I get a pointer to the "classes" folder, or any other folder that I can also read from using the classloader, so I can write to a new file?

  • Can I add or edit Keywords and captions from within the Map module?

    I frequently find a need to edit or add to the caption while reviewing  and geotagging photos in the Map module.  Constantly toggling between modules is inconvenient.  Is there a way to add/edit captions or keywords while working in the Map module  (or view the map module while working in the Library?
    Thanks!
    Steve

    thank you
          From: Modesto Vega <[email protected]>
    To: Steve Murray <[email protected]>
    Sent: Thursday, January 29, 2015 3:27 PM
    Subject:  Can I add or edit Keywords and captions from within the Map module?
    Can I add or edit Keywords and captions from within the Map module?
    created by Modesto Vega in Photoshop Lightroom - View the full discussionYou should be able to change the title, the caption, the sublocation, the city, the state/province, the country, the ISO country code, the altitude, the direction, and a few other fields. However, you cannot add keywords. It would be real nice if Adobe could add this to the Map module. If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7145077#7145077 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7145077#7145077 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Photoshop Lightroom by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • I have an external hard drive, from Iomega. However, I cannot copy or save any file to it. On my PC it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?

    I have an external hard drive, from Iomega. that I can open and see my files. However, I cannot copy or save any file to it. On my PC I have it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?
    Also, Im a photographer, so I like to name a lot of files at the same time (used to do in on PC and it was very usefull.) cannot find out how to do it on my Mac. Really appretiate if some one can give me a solution! Thanx

    Your drive is formatted with the NTFS file system.  OS X can read but not write to the NTFS file system.  There are third party drivers available that claim to add the ability to OS X to write to an NTFS partition.  I have not tried them and don't know if they work.
    The only file system that OS X and Windows can both write to natively is the FAT32 file system.

  • I have iphone 4s and just bought an ebook for ibook, trouble is the font is so tiny I can't read it and the font sizer is not working? Please help!

    Hi, I have the  iphone 4s and just bought an ebook for ibook, trouble is the font is so tiny I can't read it and the font sizer is not working? Please help!

    Hello Glittergirl68,
    Thank you for using Apple Support Communities.
    It sounds like the function to reseize the Font in an iBook is not functioning properly.
    I recommend a few things here. First close all the apps that are running in the background:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    From: iOS: Force an app to close
              http://support.apple.com/kb/ht5137
    When you have done that, restart the phone, and try again.
    If the issue persists, I would follow these steps from the article:
    iOS: Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    2. Check for app updates
    You can setup apps to update automatically in Settings > iTunes & App Store, but make sure that your apps are up to date:
    Open the App Store and tap Updates. If updates are available, tap Update All.
    If  prompted, enter your iTunes Store account information. App Store will then download and install the app updates.
    Note: Some apps may require a Wi-Fi connection to update.
    3. Install another app from the App Store
    If none of your user-installed apps will launch, there could be an issue with Apple ID authorization. Download and install an app that isn't already installed on your device to reset this information. You can also remove an app from your iOS device and download it again from the App Store or sync the app from your computer.Note: If you have installed apps using multiple Apple ID accounts, you may need to perform this step for each account.
    4. Restart the app
    If the issue affects only a single app, try closing just that app.
    5. Restart your device
    Turn the device off and on.
    6. Reinstall the affected app
    Remove the app from your device and reinstall it:
    Tap and hold any app icon on the Home Screen until the icons start to wiggle and show a small "x" in the top-right corner of the app.
    Tap the "x" in the corner of the app you want to delete.
    Tap Delete to remove the app and all of its data from your device.
    Press the Home button.
    Go to the App Store.
    Search for the app and then download it again.
    All the very best,
    Sterling

  • Help required please. "Itunes can not read the contents of my iphone"

    Greetings all,
    I know this question has been asked before and I apologize for asking again but all the solutions provided don't seam to work for me, can anyone help me please.
    I am receving the message: "Itunes can not read the contents of the iPhone. Go to the summary tab In iPhone Preferences and click restore torestore this Iphone to factory settings".
    Now a little about my iphone, Itunes and my laptop and what steps i havealready tried.
    I have an iPhone 4 running software 5.0
    My itunes version is 10.5.0.142
    I know these are not the most up to date versions but I have had this issue for almost 3 months now and updating the software back then was the first step I tried. I don’t believe updating to the latest will fix this issue as updating the last two times did nothing.
    Every so often after starting Itunes, The program will stop responding and will require the three finger death kill (CTRL, ALT, DELETE) to open task manager to end the task of Itunes. Once it shuts down, I restart the iTunes and it runs smoothly, apart from not reading my iPhone.
    When I run a diagnostic in itunes under the help tab, I get these fail messages:
    Network Connectivity test: Secure link to Itunes store fail
    Device connectivity test: Under support services: Itunes helper is not running. And under ports: No iPod, iPhone or iPad found.
    Device Sync test: No iPod touch, iPhone or iPad found.
    *See below for full diagnostic report*
    I have restored back to factory settings twice.
    I have shut down and restarted both my iPhone and laptop.
    I am running Windows 7 32-bit on my laptop.
    I am using ZoneAlarm as my fire wall, and have been disabling it when syncing my iPhone to prevent other error messages.
    The iPhone is plugged into a genuine Iphone USB cable and is plugged into a USB port not a USB hub on my laptop, I have tried plugging it into all 4 USB ports and this issue still persist. The Cable is less then 5 months old, is not frayed or damaged in any way, have also borrowed 2 other cables from friends and still the same issue.
    The iPhone does not even come up in windows explorer as a digital camera.
    The iPhone is NOT jailbroken
    I do not live close to a so called genius bar, however I have made the journey to them on 3 separate occasions last year when I first received my iPhone for a different issue, the so called genius's could not fix the problem so they just gave me a new (refurbished) iPhone, which did not extend my warranty. I will not be taking the iPhone back to them as I believe they can not resolve many issues, this is why I am reaching out to the power of the people in the wider apple community.
    I have read in other forums about ifunbox and other programs for jail broken iPhones to isolate folders “iTunesDB” and "iTunesCDB" and delete them. If this is the issue is there a way to access these files through windows explorer as my iphone is not jailbroken.
    I hope I have provided enough information and someone can help me fix this issue. If I have left anything out, please let me know. I thank everyone in advance for your patience and support.
    Thanks
    Hoggie27
    FULL DIAGNOSITC REPORT
    Microsoft Windows 7 Home Premium Edition Service Pack 1 (Build 7601)
    Hewlett-Packard HP Pavilion dv6 Notebook PC
    iTunes 10.5.0.142
    QuickTime not available
    FairPlay 1.13.35
    Apple Application Support 2.1.5
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 4.0.0.96
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.3.494
    Gracenote MusicID 1.9.3.106
    Gracenote Submit 1.9.3.136
    Gracenote DSP 1.9.3.44
    iTunes Serial Number 001BAD14XXXXEA78
    Current user is an administrator.
    The current local date and time is 2011-11-16 10:04:53.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    Video Display Information
    NVIDIA, NVIDIA GeForce GT 230M 
    **** External Plug-ins Information ****
    No external plug-ins installed.
    The drive H: Vodafone  USB SCSI CD-ROM Rev  USB is a USB 1 device.
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name:    {97524DB0-B9DC-41DB-8AFA-0CE6938F7C95}
    Description:    PC
    IP Address:    (HAS BEEN REMOVED FOR PERSONAL REASONS)
    Subnet Mask:    255.255.255.255
    Default Gateway:    0.0.0.0
    DHCP Enabled:    No
    DHCP Server:   
    Lease Obtained:    Thu Jan 01 11:00:00 1970
    Lease Expires:    Thu Jan 01 11:00:00 1970
    DNS Servers:    10.143.147.147
            10.143.147.148
    Adapter Name:    {BFF0456E-DE42-4FEF-B1FA-1EA1C5EDEE42}
    Description:    Vodafone Mobile Broadband Network Adapter (ZTE)
    IP Address:    0.0.0.0
    Subnet Mask:    0.0.0.0
    Default Gateway:    0.0.0.0
    DHCP Enabled:    No
    DHCP Server:   
    Lease Obtained:    Thu Jan 01 11:00:00 1970
    Lease Expires:    Thu Jan 01 11:00:00 1970
    DNS Servers:   
    Adapter Name:    {D5511FFD-0CA8-4F62-B3CA-E90384FFCD03}
    Description:    Broadcom 43225 802.11b/g/n
    IP Address:    0.0.0.0
    Subnet Mask:    0.0.0.0
    Default Gateway:    0.0.0.0
    DHCP Enabled:    Yes
    DHCP Server:   
    Lease Obtained:    Thu Jan 01 11:00:00 1970
    Lease Expires:    Thu Jan 01 11:00:00 1970
    DNS Servers:   
    Active Connection:    PC
    Connected:    Yes
    Online:        Yes
    Using Modem:    Yes
    Using LAN:    No
    Using Proxy:    No
    SSL 3.0 Support:    Enabled
    TLS 1.0 Support:    Enabled
    Firewall Information
    Windows Firewall is on.
    iTunes is NOT enabled in Windows Firewall.
    ZoneAlarm Firewall is installed.
    Connection attempt to Apple web site was successful.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was unsuccessful.
    The network connection timed out.
    Connection attempt to Gracenote server was successful.
    Last successful iTunes Store access was 2011-11-16 09:59:57.
    **** CD/DVD Drive Tests ****
    LowerFilters: Afc (1.0.0.2),
    UpperFilters: GEARAspiWDM (2.2.0.1),
    F: hp CDDVDW TS-L633N, Rev 0300
    Drive is empty.
    **** Device Connectivity Tests ****
    iPodService 10.5.0.142 is currently running.
    iTunesHelper is currently not running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B34.  Device is working properly.
    Intel(R) 5 Series/3400 Series Chipset Family USB Enhanced Host Controller - 3B3C.  Device is working properly.
    FireWire (IEEE 1394) Host Controllers:
    1394 OHCI Compliant Host Controller.  Device is working properly.
    Most Recent Devices Not Currently Connected:
    iPhone 4 (GSM) running firmware version 5.0
    Serial Number:    85107XQLA4S
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.
    < Edited By Host >

    Hi AM_Kidd.
    Thanks for your reply.
    I have done a complete uninstall and re install of iTunes and all related apple programs from my laptop through control panel, add remove programs and also by going through program files and deleting all tracers of any left over folders remove programs may have missed.
    My apologies for forgetting to add this in my original post.
    Thanks again

  • Help. External Hard drive "In use," can't read or write

    I was copying files from my iMac desktop to an external drive that I have been using for years. Suddenly, the drive didn't complete the operation. Now I can't read or write. Permissions seem fine. Tried to verify and repair in disc utility, but got a "unable to unmount disc" message. Then drive has to be force ejected. Rebooting is stalled until I unplug the drive. Can't even create a disc image of it. Tried booting in safe mode to do Disc Utility - no dice. Any help? Desparate.
    Douglas

    Oh... in use... see if Spotlight or Time Machine is trying to use it.
    Open Console in Applications>Utilities & see if there are any clues or repeating messages when this happens.

  • Since I upgrade to Lion OS my optical drive stop working can't read or write at all I did what I could to fix it but still not working , any help please

    Since I upgrade to Lion OS my optical drive stop working can't read or write at all I did what I could to fix it but still not working , any help please

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • I just downloaded the newest version of Itunes.  I can't delete anything and I can't sync to my MP3 player.  I tried deleting it and installing an earlier version of Itunes but it can't read the library.  Please help.

    I just downloaded the newest version of Itunes on my Windows 7 PC.  I can't delete anything and I can't sync to my MP3 player.  I tried deleting it and installing an earlier version of Itunes but it can't read the library.  Please help.

    With iTunes 11 on PCs the drop-down menus are hidden by default - control-B should get the menus to show
    This screenshot is from a Mac, but it should be similar on a PC :

  • I have CS4 and was using a Canon 5D Mark II with raw photos. I just got the Canon 5D Mark III and CS4 now can not read the raw photos. It has raw version 5.7.0.213 and CS4 version 11.0.2. Can anyone help?

    I have CS4 and was using a Canon 5D Mark II with raw photos. I just got the Canon 5D Mark III and CS4 now can not read the raw photos. It has raw version 5.7.0.213 and CS4 version 11.0.2. Can anyone help?

    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications
    EOS 5D Mark II
    CR2
    5.2
    2.2
    EOS 5D Mark III
    CR2
    6.7, 7.1
    4.1
    Photoshop CS6
    7.0
    8.3
    Photoshop CS5
    6.0
    6.7
    Photoshop CS4
    5.0
    5.7
    The 5D Mark II was first supported by Camera Raw 5.2 which is compatible with CS4+.
    The 5D Mark III was first supported by Camera Raw 6.7 and 7.1 which is only compatible with CS5 and CS6.
    So the CS4 will never be able to open Raw 5D Mark III files.
    Why doesn’t my version of Photoshop or Lightroom support my camera?
    Choices:
    Purchase CS6 full version (CS4 is too old to qualify for an upgrade)
    Join the Cloud
    Free option: download the free Adobe DNG converter, convert all 5D Mark III Raw files to DNG format then edit the DNGs in CS4
    Photoshop Help | Digital Negative (DNG)

  • I downloaded Adobe Reader 9.3 and now I can't read or print out any of my Pdf files.  Help!

    I downloaded Adobe 9.3 and now I can't read or print
    any of my Pdf files.  Help!

    Windows 7.  I get an error Message - Runtime Error - A network error occurred while attempting to read from the file.  Routine Error - This application has requested the runtime to terminate in an unusual way.

Maybe you are looking for